LocalFileStorable
public protocol LocalFileStorable
an object that can be represented and stored as a local file
-
specifies the data structure that will be stored
Declaration
Swift
associatedtype Element : Reflectable, Comparable, Decodable, Encodable, Hashable, Identifiable -
defines the data that will be stored
Declaration
Swift
var wrappedValue: [Element] { get set } -
defines a
Stringthat characterizes the unique attributes of thewrappedValueDeclaration
Swift
var storagePath: String { get }
-
localStorageURLExtension methodURLof the parent folder to store the variable inDeclaration
Swift
public var localStorageURL: URL { get }
-
loadFromFile()Extension methodLoad an array of
LocalFileStorablesfrom a fileDeclaration
Swift
public func loadFromFile() -> [Element]Return Value
an array of decoded objects
-
saveToFile(_:Extension method) Save a collection of
LocalFileStorablesto a fileDeclaration
Swift
public func saveToFile(_ collection: [Element])Parameters
collectionCollectionof objects that should be saved
View on GitHub
LocalFileStorable Protocol Reference