Post

Replies

Boosts

Views

Activity

Comment on Does swiftUI .alert miss a completion handler?
In my app the object collecting errors and messages is a global object and not living in the UI - it has to be. Also it shouldn't really matter. It is def a problem with the viewcontroller displaying the alert as it works with a delay. It's not a problem of the ObservedObject disappearing.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Comment on Does swiftUI .alert miss a completion handler?
StateObject would be appropriate if the object only lives in the UI - which it does not (and cannot) in my case.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Comment on Does swiftUI .alert miss a completion handler?
In my (larger project app) the class collecting the messages is a Singleton and not strictly owned by the UI. The static var shared = Messages() should take care of the reference so that @StateObject would be wrong here.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22