Watch iCloud for changes in the destination list.
This commit is contained in:
parent
dffbd0ec1c
commit
0138a4de79
|
@ -61,11 +61,20 @@ class GSDestinations : ObservableObject {
|
|||
|
||||
private func saveDestinations() {
|
||||
NSUbiquitousKeyValueStore.default.set(storedDestinations, forKey: GSDestinations.kDestinationKey)
|
||||
NSUbiquitousKeyValueStore.default.synchronize()
|
||||
}
|
||||
|
||||
@objc func onUbiquitousKeyValueStoreDidChangeExternally(notification:Notification)
|
||||
{
|
||||
loadDestinations()
|
||||
}
|
||||
|
||||
init() {
|
||||
loadDestinations()
|
||||
|
||||
// JSR_TODO - Add code here to watch for changes from iCloud
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(onUbiquitousKeyValueStoreDidChangeExternally(notification:)), name: NSUbiquitousKeyValueStore.didChangeExternallyNotification, object: NSUbiquitousKeyValueStore.default)
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>246</string>
|
||||
<string>249</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
|
Loading…
Reference in New Issue