iOS 9 (13A4305g): Support App Groups with NSUserDefaultsDidChangeNotification

Originator:robotspacer
Number:rdar://22046331 Date Originated:29-Jul-2015 02:19 AM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 9 (13A4305g)
Classification:Enhancement Reproducible:N/A
 
Summary:
With all of the extension types in iOS 9, it would be extremely helpful if NSUserDefaultsDidChangeNotification would fire in a parent app when its extension updates a value, or vice versa. This would be especially useful with Split View on the iPad, or with Watch apps. Previously it was enough to check for changed settings when the app activated, but now there are scenarios where an extension can be running while the parent app continues to be active.

Steps to Reproduce:
Here's a particular scenario I'm dealing with now:

- An iPad app has a Share or Action extension
- The iPad app is opened
- Split View is opened, with an app that can activate the extension—Safari for example
- I tap the Share button in Safari and choose my app's extension there
- I complete some action in the extension that should make the content from Safari available in my parent app

Expected Results:
I should be able to use NSUserDefaultsDidChangeNotification to monitor for when a setting has changed, so I can know when new content is available.

Actual Results:
If I set up NSUserDefaultsDidChangeNotification it doesn't fire for values saved with App Groups. There's no way for my parent app to know that new content is available, or a setting has changed, without polling continuously or using something like MMWormhole.

Version:
iOS 9 beta 4 (13A4305g)

Notes:


Configuration:
iPad Air 2, Wi-Fi, 128GB

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!