UserDefaultsSerializable
public protocol UserDefaultsSerializable
Describes a value that can be saved to and fetched from UserDefaults.
Default conformances are provided for:
BoolIntUIntFloatDoubleStringURLDateDataArraySetDictionaryRawRepresentabletypesCodabletypes
-
The type of the value that is stored in
UserDefaults.Declaration
Swift
associatedtype StoredValue -
The value to store in
UserDefaults.Declaration
Swift
var storedValue: StoredValue { get } -
Initializes the object using the provided value, or returns
nilif initialization fails.Declaration
Swift
init?(storedValue: StoredValue)Parameters
storedValueThe previously store value fetched from
UserDefaults.
View on GitHub