Post

Replies

Boosts

Views

Activity

Equivalent of NSManagedObjectContext.existingObject in SwiftData?
CoreData contexts expose a very convenient existingObject API that allows to fallback to retrieve from the persistent store in case the object is not registered in the context yet. I don't see any equivalent in SwiftData. Does that mean we should fallback to fetch methods instead? Is there any rationale behind the lack of this API other than that it's still in development. For more details about what I'm trying to do. I have a read-only context (the main context) and a read-write context. After inserting a model in the read-write context (and saving), I'd like to retrieve the equivalent object from the read-only context.
1
0
437
Jun ’23
Widget SwiftUI previews failure when adding a dependency
Repro steps: Create new project Create WidgetKit extension (verify that previews work) Create dummy framework (verify that previews still work) Link dummy framework to the widget extension At that point, preview stops working with the following error: "RemoteHumanReadableError ProcessError: Failed to launch widget extension: The operation couldn’t be completed. (CHSErrorDomain error 1050.)" What can I do to make this work?
10
1
5.5k
Oct ’20