NSUserDefaults (even with an App Groups) don't sync between the iPhone and the Watch. If you want to sync settings from either your iPhone app or the Settings-Watch.bundle, you have to handle the syncing yourself.I've found that using WatchConnectivity's user info transfers works really well in this case.Below you'll find an example of how you could implement this. The code only handles one-way syncing from the phone to the Watch, but the other way works the same.In the iPhone app:1) Prepare dictionary of settings that need to be synced- (NSDictionary *)exportedSettingsForWatchApp { NSUserDefaults *userDefaults = [self userDefaults]; // the user defaults to sync NSSet *keys = [self userDefaultKeysForWatchApp]; // set of keys that need to be synced NSMutableDictionary *exportedSettings = [[NSMutableDictionary alloc] initWithCapacity:keys.count]; for (NSString *key in keys) { id object = [userDefaults objectForKey:key]; if (object != nil) { [exportedSettings setObject:object forKey:key]; } } return [ex
Topic:
App & System Services
SubTopic:
Core OS
Tags: