In my SpriteKit game I use UserDefaults to save high scores etc. Works fine, everything working smoothly.
however - I just updated some devices to iOS 10.3 (release, not beta) and I noticed that previously saved data is wiped...
new data is preserved - eg - a new high score is recorded, so the userDefaults are still being set once they are created.. but I wouldn't have expected 10.3 to wipe the old data ??
I imagine this is something to do with the new APFS ?
I have not tested this in any other apps yet - has anyone else seen this issue ? any idea how to prevent this happening in future ?
thanks.
example of setting a default: (Swift 3)
if (UserDefaults.standard.value(forKey: "highScoreLife") == nil) {
highScoreLife = 0
UserDefaults.standard.set(highScoreLife, forKey: "highScoreLife") } else {
highScoreLife = Int32(UserDefaults.standard.integer(forKey: "highScoreLife") as Int)
}