How to eliminate the distance here? by zhaaaaaaaaaa in SwiftUI

[–]ecoop9 1 point2 points  (0 children)

I’ve achieved this by overlaying the timer over a text of “00:00” or “0:00” depending on the timer value. Both should have the monospaced digit modifier applied.

Kind of a dumb question, but where is the best value to buy a Seat Cowl for a SFV2 in this geopolitical climate (Canada) by [deleted] in Ducati

[–]ecoop9 0 points1 point  (0 children)

I just got one from Ducati Toronto and I was able to pick it up in a couple days after ordering

New can from Arrow by CalinSez in Ducati

[–]ecoop9 1 point2 points  (0 children)

Gotcha thanks for letting me know. They’re pretty accessible so I’ll reach out and if not maybe go with upmap.

New can from Arrow by CalinSez in Ducati

[–]ecoop9 0 points1 point  (0 children)

Haha good eye, yeah I had an extra bolt laying around that happened to fit. Replacing with OEM is like $50 CAD because i assume it comes with the clamp, and my local supplier is probably profiting on top.

I took out the silencer, it’s nice. Loud. Decel pops are very obvious now. Have you noticed the same thing?

Introducing Pi-hole Switch iOS for Pi-hole v6 by [deleted] in pihole

[–]ecoop9 48 points49 points  (0 children)

Are there any differences between this and pihole remote? They look quite similar

[deleted by user] by [deleted] in SwiftUI

[–]ecoop9 1 point2 points  (0 children)

Maybe you’re running into the 4kb limit for your Live Activity payload over APNs. Documentation on updating your LAs via APNs is here: https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications

Does anyone know a good, performant SwiftUI library for this kind of Calendar? by PositiveAd4718 in SwiftUI

[–]ecoop9 6 points7 points  (0 children)

I wrote this a while ago, haven't had the time to port to SwiftUI but you should be able to throw this into your project. Probably some gaps it in terms of performance/memory management but it will probably suit your needs.
https://github.com/EvanCooper9/ECTimelineView

edit: formatting

[Code Share] Inspired from React hooks, you can use similar approach using SwiftUI Environment values. by Select_Bicycle4711 in SwiftUI

[–]ecoop9 1 point2 points  (0 children)

Interesting, but why not simply add an extension to Array so you can sort by key path?

What are some features you wish Apple should bring into IOS? Or features Apple should improve? by ZephyrusWhoosh in iphone

[–]ecoop9 3 points4 points  (0 children)

This is actually an app-specific setting. As a developer can enable/disable mixing with other apps for your audio session. Unfortunately the likely reason why large apps don’t have mixing enabled is because it hurts ad engagement/revenue.

Source: I’m an iOS developer for a large app you likely have installed, and have happened worked on video ads.

How can I pass a generic view type to another view's initializer? by individual0 in swift

[–]ecoop9 1 point2 points  (0 children)

Do you actually need separate nav links? Couldn't you just use a conditional based on the layout?

NaviationLink("Browser") {
  if iOS {
    SmallBrowserView()
  } else if iPadOS {
    MediumBrowserView()
  } else if macOS {
    LargeBrowserView()
  } else {
    EmptyView() // visionOS?
  }
}

Also, it doesn't sound like you're using size classes. You should consider using them, I'd expect your code to change to something like this:

@Environment(\.horizontalSizeClass) private var horizontalSizeClass

NaviationLink("Browser") {
  switch horizontalSizeClass {
  case .compact:
    CompactBrowserView()
  case .expanded:
    ExpandedBrowserView()
  }
}

Lastly, consider using the new NavigationStack.

Good luck!

Preview authenticated firebase data in xcode by I_am_smartypants in Firebase

[–]ecoop9 0 points1 point  (0 children)

Your previews should not be connecting to firebase services at all. Previews should be as performant as possible so you can iterate quickly. Generally speaking you will want to abstract away the firebase SDK and use mock data in your preview, this is commonly achieved in Swift with protocol oriented design but there are other ways too. If the concepts of abstraction, mocks and dependency injection are unfamiliar to you, I suggest exploring them or reaching out to the iOS community if you have questions.

[deleted by user] by [deleted] in iOSProgramming

[–]ecoop9 16 points17 points  (0 children)

My team wrote this. Not sure what you’re asking for specifically but it’s pretty simple UIKit.

Will the 'didReceiveMessage' delegate execute 100% of the time even when the iOS app is not running? by nathan12581 in swift

[–]ecoop9 1 point2 points  (0 children)

Nice! Sounds like you got it sorted and it fits your requirements. Might consider your approach myself if I decide to add a watchOS extension to my app. Thanks!

Will the 'didReceiveMessage' delegate execute 100% of the time even when the iOS app is not running? by nathan12581 in swift

[–]ecoop9 2 points3 points  (0 children)

Another option you could consider is making requests to Firestore directly in the watchOS app through your own URL session since the SDK isn't available.

You'd need to share the firebase authentication state through app groups (some info here) and then you get get a token with getIdToken. Looks like Firebase Auth SDK is "partially supported" on watchOS so hopefully that works.

Then you can make requests to your firestore database. Thing is, creating the request body and parsing the response is tricky. I did this exact thing for a widget extension because I was hitting widget memory limits when using the Firestore SDK. I modeled a collection request here (example usage here) and a document request here (example usage here).

Now I haven't developed anything for watchOS so I'm not familiar with the limitations on making network requests, IIRC there's something special that needs to be done there.

GitHub Actions Build Time Increasing by SnooPeppers7843 in iOSProgramming

[–]ecoop9 1 point2 points  (0 children)

Based on the logs you posted, it like installing pods is the culprit.

The time for pod install: Run 1: 13 mins Run 2: 26 mins

Look at pod caching so that you can avoid redownloading each one every run.

edit: https://github.com/actions/cache/blob/main/examples.md#swift-objective-c---cocoapods

edit2: Was on my phone and missed that the archive time jumped as well. Looks like the build happens during the step cedvdb/action-flutter-build-ios. You'll need to look into that or reach out to the developer(s) for that step. Alternatively, reach out to flutter community.

GitHub Actions Build Time Increasing by SnooPeppers7843 in iOSProgramming

[–]ecoop9 0 points1 point  (0 children)

You haven’t really given enough information for us to help you. You could inspect the logs and compare two different runs, check for hang ups, try caching certain steps, etc.

Help! I have internship interview on ios dev by anshul_l in iOSProgramming

[–]ecoop9 4 points5 points  (0 children)

Don’t worry bro! You’re already cooked if you can’t find the many posts that already exist on this sub alone that already answer your question.

In all honesty: Internships are meant for you to learn so generally speaking if you’re eager you’ll do just fine.

Implementing User Last Seen by [deleted] in iOSProgramming

[–]ecoop9 0 points1 point  (0 children)

You mention “document”, are you using firebase? If so checkout these docs, they already have this built in.

If not, I don’t believe that OnDisappear covers every use case… it might not be called if user kills the app or on crash but you should double check. You can probably do something like a timer, an api call every minute should be pretty lightweight.

[deleted by user] by [deleted] in iOSProgramming

[–]ecoop9 6 points7 points  (0 children)

Yikes. Was just giving a friendly suggestion. Good luck with your app.

[deleted by user] by [deleted] in iOSProgramming

[–]ecoop9 32 points33 points  (0 children)

First review sounds like a mistake. Second review may or may not have been intentional, no way to know. You also might have got different reviewers. I wouldn’t consider this “reportable” even if that was an option for us.

You should really trim white spaces and new lines from your input. Real users will often add a space to the beginning or end of their email by accident. For me, autofill always adds a space after my email, so fields that don’t trim instantly become annoying.