diff --git a/ListenerGS/GSDestinations.swift b/ListenerGS/GSDestinations.swift
index 43f546a..8bb7a3a 100644
--- a/ListenerGS/GSDestinations.swift
+++ b/ListenerGS/GSDestinations.swift
@@ -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)
}
}
diff --git a/ListenerGS/Info.plist b/ListenerGS/Info.plist
index d1f84df..8dbd246 100644
--- a/ListenerGS/Info.plist
+++ b/ListenerGS/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
1.0
CFBundleVersion
- 246
+ 249
LSApplicationCategoryType
public.app-category.utilities
LSRequiresIPhoneOS