Post

Replies

Boosts

Views

Activity

Reply to Using Core Data with SwiftUI App Protocol
@DannyCamenisch @ryanbdevilled  Add this variable to the PersistentStore: var context: NSManagedObjectContext { 		return persistentContainer.viewContext } Then you can pass this in the environment as follows: var body: some Scene {        		 WindowGroup {            					MovieList() 							 .environment(\.managedObjectContext, PersistentStore.shared.context) 					} }
Jul ’20