CompositeCodableStoring

public protocol CompositeCodableStoring : CodableStoring

CompositeCodableStoring API By design the implementer must have a default memory storage which can be extended later with another persistent storage. When a persistent store is set the class works as a cache: checks the memory store first. All the objects must be encoded to Data with any coder first and then store the encoded value in the memory and persistent store. The implementation must move all the data from memory store to the persistent store after the persistent store is set.

  • Store where the data will be saved. This can be any custom store which conforms to the DataStoring protocol

    Declaration

    Swift

    var persistentStore: DataStoring? { get }
  • Function to set the store where the data will be saved.

    Declaration

    Swift

    func setPersistentStore(_ store: DataStoring) throws

    Parameters

    store

    A store which conforms to the DataStoring protocol

  • Releases the persistent store

    Declaration

    Swift

    func releasePersistentStore()