Created
August 21, 2018 17:44
-
-
Save Arrlindii/ae9d3010e6476a316f203183a3a795be to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Defaults { | |
| static var mainFormStates: [Memento] { | |
| get { | |
| return UserDefaults.standard.array(forKey: UserDefaultConstants.mainForm.rawValue) as? [Memento] ?? [Memento]() | |
| } | |
| set { | |
| UserDefaults.standard.set(newValue, forKey: UserDefaultConstants.mainForm.rawValue) | |
| UserDefaults.standard.synchronize() | |
| } | |
| } | |
| } | |
| enum UserDefaultConstants: String { | |
| case mainForm | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment