UserDefaultsStorage
open class UserDefaultsStorage : UserDefaults, Storage
UserDefaultsStorage
subclass of UserDefaults
that uses a DelegatedStorage
.
-
UserDefaultsStorage
shared instance.Declaration
Swift
open override class var standard: UserDefaultsStorage { get }
-
Create a
UserDefaultsStorage
.Declaration
Swift
public convenience init(authenticationTag: Data? = nil)
Parameters
authenticationTag
Custom additional
Data
to be authenticated. -
Create a
UserDefaultsStorage
.Declaration
Swift
public init?(suiteName suitename: String?, symmetricKey: SymmetricKey, authenticationTag: Data? = nil)
Parameters
suiteName
The domain identifier of the search list.
symmetricKey
A cryptographic key used to seal the message.
authenticationTag
Custom additional
Data
to be authenticated. -
Returns the
StorageData
associated with the specifiedStoreKey
.Declaration
Swift
open func data<D>(forKey key: StoreKey) -> D? where D : StorageData
Parameters
key
A
StoreKey
in storage. -
Sets the value of the specified
StoreKey
to the specifiedStorageData
.Declaration
Swift
open func set<D>(_ data: D?, forKey defaultName: StoreKey) where D : StorageData
Parameters
data
StorageData
to store.defaultName
The
StoreKey
with which to associate the value. -
Adds the contents of the specified dictionary to the registration domain.
Declaration
Swift
open override func register(defaults registrationDictionary: [StoreKey : Any])
Parameters
defaults
The dictionary of keys and values you want to register.