StorageCrypto Documentation

Extensions on Storage

Methods

transient()

static func transient<I: Storable>() -> Self where Self == TransientStorage<I>  

Compose an instance of TransientStorage.

Returns

An instance of Self.

user​Defaults(_:​)

static func userDefaults<I: Storable>(_ userDefaults: UserDefaults = .standard) -> Self
    where Self == UserDefaultsStorage<I>  

Compose an instance of UserDefaultsStorage.

Parameters

user​Defaults User​Defaults

Some UserDefaults. Defaults to .standard.

Returns

An instance of Self.

remove​All()

func removeAll() throws  

Remove all associated items.

erase​ToAny​Storage()

func eraseToAnyStorage() -> AnyStorage<Item>  

Type-erase the current instance.

Returns

A valid AnyStorage.