UserDefault
@propertyWrapper
public struct UserDefault<Value>
-
Declaration
Swift
public var defaultValue: Value -
Declaration
Swift
public var storage: UserDefaults -
Declaration
Swift
public init(_ key: String, defaultValue: Value, storage: UserDefaults = .standard) -
Declaration
Swift
public init<Key: RawRepresentable>( _ key: Key, defaultValue: Value, storage: UserDefaults = .standard ) where Key.RawValue == String -
Declaration
Swift
public var wrappedValue: Value { get set }
-
Creates a UserDefaults wrapper with a default value of
falseDeclaration
Swift
public init(_ key: String)Parameters
keykey of stored value
-
Convenience initalizer for nil-able values.
Using this initializer it is not necessary to set a
defaultValueofnil.Declaration
Swift
public init(_ key: String)Parameters
keyKey for locating value in storage
-
Convenience initalizer for nil-able values.
Using this initializer it is not necessary to set a
defaultValueofnil.Declaration
Swift
public init<Key>(_ key: Key) where Key : RawRepresentable, Key.RawValue == StringParameters
keyKey for locating value in storage
View on GitHub