Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 420 Bytes

File metadata and controls

20 lines (19 loc) · 420 Bytes

UserDefaultsEVO

Using UserDefaults in a swift way

Usage

define a Enum which rawValue is String, comform to UserDefaultSettable

extension UserDefaults {
    enum TestData: String,UserDefaultSettable {
        case name
    }
}

store value:

UserDefaults.TestData.name.store(value: "name")

get value form UserDefaults:

 let storeValue = UserDefaults.TestData.name.storedString