Skip to content

Commit

Permalink
Enable posting remote change notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
acwright committed Nov 12, 2019
1 parent 49174c8 commit 6b82fc5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/Cabinet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ public class Cabinet: NSObject {
container = NSPersistentCloudKitContainer(name: self.containerName)
} else {
container = NSPersistentContainer(name: self.containerName)

let description = container.persistentStoreDescriptions.first
description?.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
}

let description = container.persistentStoreDescriptions.first
description?.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
description?.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)

container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error: \(error)")
Expand Down

0 comments on commit 6b82fc5

Please sign in to comment.