Post

Replies

Boosts

Views

Activity

Comment on SwiftUI sheet dismiss warning
Wondering the same thing. I have logic in my ViewModel that subscribes to the state of that @Published variable. If the view were to own it fully as a @State variable, it'd have to propagate that state back to the model on every change, which doesn't even seem possible to do when the sheet is dismissed with a swipe. Even if it was, it's highly undesirable to maintain duplicate state.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Comment on SwiftUI sheet dismiss warning
Wondering the same thing. I have logic in my ViewModel that subscribes to the state of that @Published variable. If the view were to own it fully as a @State variable, it'd have to propagate that state back to the model on every change, which doesn't even seem possible to do when the sheet is dismissed with a swipe. Even if it was, it's highly undesirable to maintain duplicate state.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on SwiftUI sheet dismiss warning
By the way another thing that seemed natural to try was to dismiss by changing the @Published property to false instead of calling dismiss(). This worked, but the warning was still there.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on SwiftUI ScrollViewProxy.scrollTo(_:anchor:) always crash in iOS 16 beta 7: NSInternalInconsistencyException
Great find using the custom introspect to pull out the collection view!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22