Created
August 28, 2020 07:50
-
-
Save Akhrameev/5d64fd92ea23b37b66fc9b4851043519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UDvars { | |
var AppLaunch: Int = UserDefaults.standard.object(forKey: "AppLaunch") as? Int ?? 0 { | |
didSet { | |
UserDefaults.standard.set(AppLaunch, forKey: "AppLaunch") | |
} | |
} | |
var Bool: Bool = UserDefaults.standard.object(forKey: "Bool") as? Bool ?? false { | |
didSet { | |
UserDefaults.standard.set(Bool, forKey: "Bool") | |
} | |
} | |
var String: String = UserDefaults.standard.object(forKey: "String") as? String ?? "" { | |
didSet { | |
UserDefaults.standard.set(String, forKey: "String") | |
} | |
} | |
} | |
let GlobalVars = UDvars() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
synchronize is not necessary now. See release notes and header, that mentions that.