Post

Replies

Boosts

Views

Activity

Reply to @Published properties and the main thread
We are using async. If I have an object that has a load() async method and a .loadStatus property (values might be something like not-loaded, loading, loaded), and the .load() can be called from and completed on an arbitrary thread (it might make a network request let's say). I like the pattern of our properties that can change being @Published as a built-in property wrapper for this situation. However, in our case where the method can complete on any given thread you end up with a bug like this: foo.load() XCTAssertEquals(foo.loadStatus, .loaded) This fails, loadStatus is "loading" because it's Published and I have to DispatchQueue.main.async the load status update to avoid purple runtime errors.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Finding device heading with ARKit and ARGeoTrackingConfiguration
I no longer have a need for this. I misunderstood the worldAlignment property. Now that I understand it, I don't need this specific question answered
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to Testing/Debugging Background Session Code
Actually, my logging wasn't working as I thought it was. I'm still not seeing UIApplication.willTerminateNotification which might be intended, but I am seeing the relaunch work with exit now that I've fixed the logging.
Replies
Boosts
Views
Activity
Aug ’23
Reply to Issues implementing ASWebAuthenticationPresentationContextProviding with Xcode 14
Actually, when building with strict-concurrency=complete and Xcode 14.3 I am seeing these errors again. ASPresentationAnchor() is MainActor, so it seems impossible to implement ASWebAuthenticationPresentationContextProviding and return a ASPresentationAnchor.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Issues implementing ASWebAuthenticationPresentationContextProviding with Xcode 14
Nevermind. We had this class embedded in a function. Removing the definition out of that scope solved it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to @Published properties and the main thread
We are using async. If I have an object that has a load() async method and a .loadStatus property (values might be something like not-loaded, loading, loaded), and the .load() can be called from and completed on an arbitrary thread (it might make a network request let's say). I like the pattern of our properties that can change being @Published as a built-in property wrapper for this situation. However, in our case where the method can complete on any given thread you end up with a bug like this: foo.load() XCTAssertEquals(foo.loadStatus, .loaded) This fails, loadStatus is "loading" because it's Published and I have to DispatchQueue.main.async the load status update to avoid purple runtime errors.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21