Easy and elegant uses UserDefault.
- iOS 8.0+
- Swift 3.0+
available on CocoaPods. Just add the following to your project Podfile:
pod 'EasyUserDefault'
use_frameworks!
import the library in all files where you use it:
import EasyUserDefault
See the code snippet below for an example of how to implement
let storedObject = EasyUserDefault(key: "yourIdentifier")
- supported: String, Integer, Dictionary, Array, Boolean
storedObject.store(yourValue)
storedObject.storedRawValue()
storedObject.storedRawValue<String>()
let dict = try? storedObject.storedValue<[String, Any]>()
storedObject.string // Optional string
storedObject.stringValue // Non-optional string
storedObject.dictionary // Optional dictionary
storedObject.dictionaryValue // Non-optional dictionary
storedObject.array // Optional array
storedObject.arrayValue // Non-optional array
storedObject.bool // Optional bool
storedObject.boolValue // Non-optional bool
storedObject.exist()
available under the MIT license. See the LICENSE file for more info.