Posts

Post not yet marked as solved
5 Replies
I think you may be overcomplicating things. Descendent views that depend on the state variable in question will be torn down and recreated with the new value when the variable owned by the ancestor view changes—no bindings needed. I made this mistake for a while too. If you want a change in state to be animated just wrap it in withAnimation{}.If this is still unclear, do you want to post some sample code that illustrates what you're trying to accomplish and why the above approach doesn't meet your needs?
Post not yet marked as solved
1 Replies
https://forums.developer.apple.com/thread/119226
Post not yet marked as solved
4 Replies
I discovered today that there seem to be 3 different "universes" for my Core Data app's state (all using the same managed object context):1. What I see in the Canvas view while I'm not in preview mode2. What I see in the Canvas view whil I'm in preview mode3. What I see in the Simulator when I build and run my appUniverse 1 only has data added to it when I create mock Core Data objects for the purpose of live previews, but since I never save the context from a static canvas preview, this data doesn't persist, which is exactly what I want.
Post not yet marked as solved
4 Replies
Hey sj, any luck here? I too am trying to figure out how to get SwiftUI previews and Core Data playing nicely, and it's been slow going...
Post marked as solved
4 Replies
Maybe what you really want to use is @State?https://mecid.github.io/2019/06/12/understanding-property-wrappers-in-swiftui/