Protocols

The following protocols are available globally.

  • It provides standard file operations for types conforming to Codable protocol.

    GTStorable protocol provides the following operations:

    • Saving to file.
    • Loading from file.
    • Removing data file.
    • Checking for data file existence.
    • Creating data file backup.
    • Removing data file backup.

    Available API

    • save(as:usingOptions:customCoders:)
    • load(from:forObjectOfType:usingOptions:customCoders:)
    • remove(fileOfType:usingOptions:)
    • dataFileExists(ofType:withOptions:)
    • backupDataFile(ofType:usingOptions:)
    • removeBackupFile(ofType:usingOptions:)

    See the GTStorableToolkit.FileType enum for supported file types.

    Whenever options parameter is required a GTStorableToolkit.StoreOptions can be optionally provided as an argument.

    customCoders is an optional GTStorableToolkit.CustomCoders object. Use it to specify customized JSON and Property List encoders and decoders when necessary.

    Read more at the documentation of the previously mentioned custom types.

    See more

    Declaration

    Swift

    public protocol GTStorable