UserDefaultsSettings

public final class UserDefaultsSettings : VarioqubSettingsProtocol

UserDefaultsSettings is a default implementation via UserDefaults.

  • Initializes the setting with UserDefaults.

    The user can pass custom UserDefaults to share data with the application extension or for other purposes.

    Declaration

    Swift

    public init(userDefaults: UserDefaults)
  • The last date and time when the config was fetched.

    Declaration

    Swift

    public var lastFetchDate: Date? { get set }
  • The property that defines if Varioqub should notify the reporter that the experiment changed.

    Declaration

    Swift

    public var isShouldNotifyExperimentChanged: Bool { get set }
  • The E-Tag header used to detect updates on the server.

    Declaration

    Swift

    public var lastEtag: String? { get set }
  • The serialized data for the reporter.

    Declaration

    Swift

    public var reporterData: Data? { get set }
  • Stores the config fetched from the server into the key-value storage identified by the key.

    Declaration

    Swift

    public func storeNetworkData(_ data: Data?, for key: String)

    Parameters

    data

    Binary encoded network data.

    key

    Network data key.

  • Gets the config by the key.

    Declaration

    Swift

    public func loadNetworkData(for key: String) -> Data?

    Parameters

    key

    Network data key.

    Return Value

    The previously saved network data or nil if non-available.