CacheMode

public enum CacheMode : Codable, Hashable

A value representing a cache management mode for the Datasync service.

The cache is updated with data got from the Datasync service when the web socket is connected (online). Data in the cache can then be used when the web socket is disconnected (offline).

This value is used when initializing a WebcomApplication to manage how the cache is initialized and how/when it is saved.

Cases

  • no

    Indicates that no cache is used. It is not initialized and cannot be read or saved.

    When this value is used:

    Declaration

    Swift

    case no
  • Indicates that the cache is initialized and it can be read.

    When this value is used:

    Declaration

    Swift

    case initialized(data: String?)
  • Indicates that the cache is initialized and it can be read or save manually.

    When this value is used:

    Declaration

    Swift

    case manualSaving
  • Indicates that the cache is initialized and saved automatically.

    When this value is used:

    • Data possibly saved previously is loaded when the WebcomApplication instance is initialized.
    • The DatasyncService.cache property may be used to get the cache (but that shouldn’t be useful).
    • Data is saved automatically each time the application is sent to the background.
    • Data can also be saved manually using the DatasyncService.saveCache() method.

    Declaration

    Swift

    case automatic

Constants

Initializers

  • Declaration

    Swift

    public init(from decoder: Decoder) throws

Encodable Protocol

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws