Storage
public class Storage
                Storage can be used to save or cache objects that conform to Codable protocl.
See also
Codable- 
                  
                  
Storage errors
See moreDeclaration
Swift
public enum StorageError : Error - 
                  
                  
File type, currently supporting .json
See moreDeclaration
Swift
public enum FileType : String - 
                  
                  
Directory to save data
See moreDeclaration
Swift
public enum Directory - 
                  
                  
Store an encodable struct to the specified directory on disk
Declaration
Parameters
objectthe encodable struct to store
directorywhere to store the struct. It is recommended by Apple to use the Library directory, which will save the app data files into the Library/Application Support Directory. The contents of this directory are backed up by iTunes and iCloud.
fileNamewhat to name the file where the struct data will be stored
 - 
                  
                  
Retrieve and convert a struct from a file on disk
Example: A simple
Resortobjectlet resorts = retrieve("resorts", of: .json, from: .documents, as: [Resort].self)Declaration
Parameters
fileNamename of the file where struct data is stored
directorydirectory where struct data is stored
typestruct type (i.e. Message.self)
Return Value
decoded struct model(s) of data
 - 
                  
                  
Remove all files at specified directory
Declaration
Swift
public static func clear(_ directory: Directory) throwsParameters
directoryThe directory to clean
 - 
                  
                  
Returns BOOL indicating whether file exists at specified directory with specified file name
Declaration
Parameters
fileNameThe file name
fileTypeThe file type
directoryThe directory to check if the file exists
 
            View on GitHub
          
      Storage Class Reference