Storage

public protocol Storage

The Storage protocol is used to define the structre for custom key-value storage implementations.

  • Stores a generic T value for a given key.

    Declaration

    Swift

    func set<T>(value: T?, for key: String)

    Parameters

    value

    generic T value to store.

    key

    the key associated with the value.

  • Retrieves generic T value for a given key.

    Declaration

    Swift

    func getValue<T>(for key: String) -> T?

    Parameters

    key

    the key associated with the value.

    Return Value

    generic T value.