Post

Replies

Boosts

Views

Activity

Comment on SwiftData Component
You could make a DeckList View which would have the @Query var decks: [Deck]. There you could use for example a List and inside the List use your DeckRow with a single Deck as a parameter (the @Query should not be in the DeckRow anymore - replace is with var deck: Deck).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Comment on SwiftData - What is Best Practice for returning an object from a sheet
"if your list view wanted to use what was the new object created in your list view [...]" Another approach, instead of using a closure, could be to pass a binding to the new object an an optional (@Binding var newObject: NewObjectModel?). In case of "cancel" nothing would be set, so it would still be nil. And the case of save it would be set to the newly created model object and the calling view could react on that (for example with the onChange modifier).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Comment on @SceneStorage not working on macOS
Still the same behavior, even with waiting. So far all the machines I could reproduce the issue were laptops (MacBooks Pro/Intel/M1/M1 Pro), using the latest macOS, Xcode. Not sure if this is any indicator for anything, but may I ask on which machine you had success? Thank you!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Comment on SwiftData Component
You could make a DeckList View which would have the @Query var decks: [Deck]. There you could use for example a List and inside the List use your DeckRow with a single Deck as a parameter (the @Query should not be in the DeckRow anymore - replace is with var deck: Deck).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on SwiftData - What is Best Practice for returning an object from a sheet
"if your list view wanted to use what was the new object created in your list view [...]" Another approach, instead of using a closure, could be to pass a binding to the new object an an optional (@Binding var newObject: NewObjectModel?). In case of "cancel" nothing would be set, so it would still be nil. And the case of save it would be set to the newly created model object and the calling view could react on that (for example with the onChange modifier).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on @SceneStorage not working on macOS
Still the same behavior, even with waiting. So far all the machines I could reproduce the issue were laptops (MacBooks Pro/Intel/M1/M1 Pro), using the latest macOS, Xcode. Not sure if this is any indicator for anything, but may I ask on which machine you had success? Thank you!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22