-
Adds the contents of the specified dictionary to the registration domain.
Declaration
Swift
@StorageActor func register(defaults registration: [StoreKey : Any])
Parameters
defaults
The dictionary of keys and values you want to register.
-
Returns the generic value associated with the specified
StoreKey
.Declaration
Swift
@StorageActor func value<V>(forKey key: StoreKey) -> V?
Parameters
key
A
StoreKey
in storage. -
Returns the
Decodable
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func decodable<D>(forKey key: StoreKey) -> D? where D : Decodable
Parameters
key
A
StoreKey
in storage. -
Returns the
StorageData
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func data<D>(forKey key: StoreKey) -> D? where D : StorageData
Parameters
key
A
StoreKey
in storage. -
Returns the
String
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func string(forKey key: StoreKey) -> String?
Parameters
key
A
StoreKey
in storage. -
Returns the
[Any]
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func array(forKey key: StoreKey) -> [Any]?
Parameters
key
A
StoreKey
in storage. -
Returns the
Set<AnyHashable>
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func set(forKey key: StoreKey) -> Set<AnyHashable>?
Parameters
key
A
StoreKey
in storage. -
Returns the
[String: Any]
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func dictionary(forKey key: StoreKey) -> [String : Any]?
Parameters
key
A
StoreKey
in storage. -
Returns the
[String]
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func stringArray(forKey key: StoreKey) -> [String]?
Parameters
key
A
StoreKey
in storage. -
Returns the
Int
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func integer(forKey key: StoreKey) -> Int
Parameters
key
A
StoreKey
in storage. -
Returns the
Float
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func float(forKey key: StoreKey) -> Float
Parameters
key
A
StoreKey
in storage. -
Returns the
Double
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func double(forKey key: StoreKey) -> Double
Parameters
key
A
StoreKey
in storage. -
Returns the
Bool
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func bool(forKey key: StoreKey) -> Bool
Parameters
key
A
StoreKey
in storage. -
Returns the
URL
associated with the specifiedStoreKey
.Declaration
Swift
@StorageActor func url(forKey key: StoreKey) -> URL?
Parameters
key
A
StoreKey
in storage. -
Sets the value of the specified
StoreKey
to the specifiedInt
.Declaration
Swift
@StorageActor func set(_ value: Int, forKey key: StoreKey)
Parameters
value
Int
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedFloat
.Declaration
Swift
@StorageActor func set(_ value: Float, forKey key: StoreKey)
Parameters
value
Float
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedDouble
.Declaration
Swift
@StorageActor func set(_ value: Double, forKey key: StoreKey)
Parameters
value
Double
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedBool
.Declaration
Swift
@StorageActor func set(_ value: Bool, forKey key: StoreKey)
Parameters
value
Bool
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedURL
.Declaration
Swift
@StorageActor func set(_ url: URL?, forKey key: StoreKey)
Parameters
url
URL
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedString
.Declaration
Swift
@StorageActor func set(_ string: String, forKey key: StoreKey)
Parameters
string
String
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specified generic value.Declaration
Swift
@StorageActor func set<V>(_ value: V?, forKey key: StoreKey)
Parameters
value
Generic value to store.
key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedEncodable
.Declaration
Swift
@StorageActor func set(encodable: Encodable?, forKey key: StoreKey)
Parameters
encodable
Encodable
to store.key
The
StoreKey
with which to associate the value. -
Sets the value of the specified
StoreKey
to the specifiedStorageData
.Declaration
Swift
@StorageActor func set<D>(_ data: D?, forKey key: StoreKey) where D : StorageData
Parameters
data
StorageData
to store.key
The
StoreKey
with which to associate the value. -
Removes the value of the specified
StoreKey
.Declaration
Swift
@StorageActor func remove(forKey key: StoreKey)
Parameters
key
The
StoreKey
whose value you want to remove.