Merge branch 'corestore2_develop' into corestore2_develop_objc

This commit is contained in:
John Rommel Estropia
2016-04-01 07:47:03 +09:00
2 changed files with 4 additions and 2 deletions

View File

@@ -36,14 +36,14 @@ internal final class NotificationObserver {
let object: AnyObject?
let observer: NSObjectProtocol
init(notificationName: String, object: AnyObject?, closure: (note: NSNotification) -> Void) {
init(notificationName: String, object: AnyObject?, queue: NSOperationQueue? = nil, closure: (note: NSNotification) -> Void) {
self.notificationName = notificationName
self.object = object
self.observer = NSNotificationCenter.defaultCenter().addObserverForName(
notificationName,
object: object,
queue: nil,
queue: queue,
usingBlock: closure
)
}

View File

@@ -1123,6 +1123,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
self.observerForWillChangePersistentStore = NotificationObserver(
notificationName: NSPersistentStoreCoordinatorStoresWillChangeNotification,
object: coordinator,
queue: NSOperationQueue.mainQueue(),
closure: { [weak self] (note) -> Void in
guard let `self` = self else {
@@ -1144,6 +1145,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
self.observerForDidChangePersistentStore = NotificationObserver(
notificationName: NSPersistentStoreCoordinatorStoresDidChangeNotification,
object: coordinator,
queue: NSOperationQueue.mainQueue(),
closure: { [weak self] (note) -> Void in
guard let `self` = self else {