Answers for "save enum value in userdefaults swift"

0

swift userdefaults enum

//in the didMoveToView method put this code in
switchCurrentType = ExampleEnum(rawValue: UserDefaults.standard.integer(forKey: "CurrentDefaultType"))! //make sure exclamation mark at the end is there or it won't read properly
Posted by: Guest on June-10-2020
0

swift userdefaults enum

UserDefaults.standard.set(switchCurrentType.rawValue, forKey: "CurrentDefaultType")
Posted by: Guest on June-10-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language