how can i update managedobjectcontext later?

You can make view rebuild depending on your UserSettings mentioned toggle property, like

HomeTabView()
    .environment(\.managedObjectContext, persistenceController.container.viewContext)
    .environmentObject(service1)
    .environmentObject(service2)
    .id(userSettings.your_toggle_Sync_Property)    // << here !!

so, once property changed the view will be rebuilt, as property is observed, and new context will be injected.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top