Here is the code, but for some reason I get nil
when I read from Watch. Any idea what am I missing?
Writing in iOS Method
@IBAction func writeDefaults(_ sender: Any) {
UserDefaults(suiteName: "group.testingGroups")!.set(true, forKey: "myKey")
}
Reading from WatchOS
@IBAction func readDefaults() {
let readKey = UserDefaults(suiteName: "group.testingGroups")!.bool(forKey: "myKey")
print("Key Value: \(readKey)")
}
I also tried the following when reading but nothing...
let readKey = UserDefaults.init(suiteName: "group.testingGroups")!.bool(forKey: "myKey")