mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-21 08:59:24 +01:00
Merge branch 'corestore2_develop' into corestore2_develop_objc
This commit is contained in:
@@ -36,14 +36,14 @@ internal final class NotificationObserver {
|
|||||||
let object: AnyObject?
|
let object: AnyObject?
|
||||||
let observer: NSObjectProtocol
|
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.notificationName = notificationName
|
||||||
self.object = object
|
self.object = object
|
||||||
self.observer = NSNotificationCenter.defaultCenter().addObserverForName(
|
self.observer = NSNotificationCenter.defaultCenter().addObserverForName(
|
||||||
notificationName,
|
notificationName,
|
||||||
object: object,
|
object: object,
|
||||||
queue: nil,
|
queue: queue,
|
||||||
usingBlock: closure
|
usingBlock: closure
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1123,6 +1123,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
|||||||
self.observerForWillChangePersistentStore = NotificationObserver(
|
self.observerForWillChangePersistentStore = NotificationObserver(
|
||||||
notificationName: NSPersistentStoreCoordinatorStoresWillChangeNotification,
|
notificationName: NSPersistentStoreCoordinatorStoresWillChangeNotification,
|
||||||
object: coordinator,
|
object: coordinator,
|
||||||
|
queue: NSOperationQueue.mainQueue(),
|
||||||
closure: { [weak self] (note) -> Void in
|
closure: { [weak self] (note) -> Void in
|
||||||
|
|
||||||
guard let `self` = self else {
|
guard let `self` = self else {
|
||||||
@@ -1144,6 +1145,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
|||||||
self.observerForDidChangePersistentStore = NotificationObserver(
|
self.observerForDidChangePersistentStore = NotificationObserver(
|
||||||
notificationName: NSPersistentStoreCoordinatorStoresDidChangeNotification,
|
notificationName: NSPersistentStoreCoordinatorStoresDidChangeNotification,
|
||||||
object: coordinator,
|
object: coordinator,
|
||||||
|
queue: NSOperationQueue.mainQueue(),
|
||||||
closure: { [weak self] (note) -> Void in
|
closure: { [weak self] (note) -> Void in
|
||||||
|
|
||||||
guard let `self` = self else {
|
guard let `self` = self else {
|
||||||
|
|||||||
Reference in New Issue
Block a user