how can i update managedobjectcontext later?

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

    .environment(\.managedObjectContext, persistenceController.container.viewContext)
    .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