Synchronizing Main and Background Core Data Threads (Swift 3)

Let’s say we have two different managedObjectContext (with one persistentStoreCoordinator).  The first one is used across the app for most quick fetches: var mainManagedObjectContext = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.mainQueueConcurrencyType)           mainManagedObjectContext.persistentStoreCoordinator = coordinator     And the second, running in the background, for the queries that take a long time: var backgroundManagedObjectContext = NSManagedObjectContext(concurrencyType: …