[Solved] Reduce UserDefaults Integer Value – Swift

[ad_1] First, obtain the old value of the high score. Then, do the arithmetic before finally saving the new value: let oldValue = UserDefaults.standard.integer(forKey: “HIGHSCORE”) let newValue = oldValue – 20 UserDefaults.standard.set(newValue, forKey: “HIGHSCORE”) [ad_2] solved Reduce UserDefaults Integer Value – Swift