CodablePersistentService

open class CodablePersistentService<Record> where Record : Decodable, Record : Encodable

Local data storage for Codable-complience records. The data will be preserved in “Application Support” folder in application container

  • Loads data from the storage

    Declaration

    Swift

    public func loadData() -> Record?

    Return Value

    loaded records if succeed

  • Saves data to the storage

    Declaration

    Swift

    @discardableResult
    public func saveData(_ record: Record) -> Bool

    Parameters

    record

    record data to save

    Return Value

    true if success

  • Clears the storage

    Declaration

    Swift

    public func clear()