Hi, I have an app group that worked fine between my watch and iPhone using Swift 1. Now, however, nothing is saving to my app group when I use the same code to save and synch the data (and thus nothing appears on my watch).
I believe the relevant code is here:
//in the AppDelegate
var sharedData = NSUserDefaults(suiteName: "group.RxRemindMe")
//in my VC
NSKeyedArchiver.setClassName("RxRemindMe.Medication", forClass: Medication.self)
NSKeyedUnarchiver.setClass(Medication.self, forClassName: "RxRemindMe.Medication")
appDelegate.sharedData!.setObject(savedAsData, forKey: "TheMedicationsShared")
appDelegate.sharedData!.synchronize()
if I run the same .setObject command on a non-shared userDefault object, I see bytes saved (size changes to some positive bytes) and my phone app can access the data. However, when I execute line 4 above via the shared group object, the object remains nil in size and nothing has changed. I thus can't recall the data either on the phone or on the watch.
Is this a bug in Swift 2? Is there something else I need to be doing to make this work now?