StorageDelegate
public protocol StorageDelegate : AnyObject
StorageDelegate
protocol.
-
Returns the
StorageData
associated with the specifiedStoreKey
.Throws
StorageDelegate
implementation possible errors.Declaration
Swift
func data<D>(forKey key: StoreKey) throws -> D? where D : StorageData
Parameters
key
A
StoreKey
in storage. -
Sets the value of the specified
StoreKey
to the specifiedStorageData
.Throws
StorageDelegate
implementation possible errors.Declaration
Swift
func set<D>(_ data: D?, forKey key: StoreKey) throws where D : StorageData
Parameters
data
StorageData
to store.key
The
StoreKey
with which to associate the value.