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: …

Are we (NSViewController view) the First Responder?

In some cases a class may want to know if it’s the first responder before triggering an action. For instance if several loaded View Controller classes are listening for the same notification, how can they know which one should trigger the action? Well… they should ask their view.  In this case a NSTableView class is …