In WatchKit can't access UserDefaults

29 Views Asked by At

I add as a new target WatchKit and I need use in watch UserDefaults and I added both targets into single AppGroup but I can't get values from UserDefaults from WatchKit when I debug UserDefaults(suiteName: "group.com.my.app") like this it gives me value of UserDefaults and when I get value from UserDefaults it didn't gives me in Watch app but in iOS app it gives me value

UserDefaults(suiteName: "group.com.my.app")?.bool(forKey: "dark_mode") when I use this code it gives me true but in watch app it gives false in fact it should be true

Get values from Watch app in UserDefaults

0

There are 0 best solutions below