ZappStorageProtocol

@objc
public protocol ZappStorageProtocol

This prtocol represents public API for Zapp Storage

  • Save to storage item for specific key

    Declaration

    Swift

    func set(key: String, value: String, namespace: String?) -> Bool

    Parameters

    key

    The key with which to associate the value.

    value

    The object to store in storage.

    namespace

    Namespace that will be used for save item

    Return Value

    true if saving succeed

  • Retrieve value from the storage

    Declaration

    Swift

    func get(key: String, namespace: String?) -> String?

    Parameters

    key

    The key with which to associate the value.

    namespace

    Namespace that where value will be searched

    Return Value

    String Value represantation of the JSON if item was founded outherwise nil

  • Get all items for current storage

    • namespace: Namespace that where value will be searched

    Declaration

    Swift

    func getAll(namespace: String?) -> String?

    Return Value

    String Value represantation of the JSON of all items that stores in the storage, in case namespace not nil All items for defined namespace