SingletonStorageDelegate
open class SingletonStorageDelegate : StorageDelegate
SingletonStorageDelegate
conforming StorageDelegate
protocol.
-
Create a
SingletonStorageDelegate
.Declaration
Swift
public init()
-
Get
StorageData
forStoreKey
from the keychain.Declaration
Swift
@StorageActor open func data<D>(forKey key: StoreKey) -> D? where D : StorageData
Parameters
key
StoreKey
to store theStorageData
.Return Value
StorageData
forStoreKey
. -
Set
StorageData
forStoreKey
in the keychain.Declaration
Swift
@StorageActor open func set(_ data: (some StorageData)?, forKey key: StoreKey)
Parameters
data
StorageData
to store.key
StoreKey
to store theStorageData
. -
Remove
StorageData
forStoreKey
from the keychain.Declaration
Swift
@StorageActor open func remove(forKey key: StoreKey)
Parameters
key
StoreKey
to remove.