Toggler

public class Toggler

Undocumented

  • Getter/Setter for this Toggle object’s local override. When setting this value it will write to UserDefaults using the defaultsKey value as the key.

    Complexity

    O(1)

    Declaration

    Swift

    public var localOverridesEnabled: Bool { get set }

    Return Value

    A bool value representing the whether or not the local value should be used when accessing this Toggle.

  • Getter for a given Toggle object’s value. Must use this getter as name is marked internal for API purposes.

    Complexity

    O(n) where n is the first index of name in the array of toggles.

    Declaration

    Swift

    public func value(forToggle name: String) -> Bool

    Parameters

    name

    The name of the toggle that the caller is attempting to access the value of.

    Return Value

    A bool value representing whether or not the local value should be used when accessing this Toggle.

  • Setter for a given Toggle object’s value. Must use this setter as Toggler.init() is marked internal for API purposes. Calling this function will remove all duplicate Toggle objects based on the name that is passed in.

    Complexity

    O(n) where n is the number of Toggle objects inside the toggles array that have the name

    Declaration

    Swift

    public func configureToggle(withName name: String, remoteValue: Bool, abValue: String? = nil)

    Parameters

    name

    The name of the toggle that the caller is attempting to set the value of.

    remoteValue

    The value that the caller/client’s remote server has configured for this flag/toggle.

    abValue

    The conditional value that is used for this flag/toggle. Takes precedence over localValue.

  • Setter for a given Toggle object’s localValue. Must use this setter as Toggler.init() is marked internal for API purposes.

    Complexity

    O(n) where n is the number of Toggle objects inside the toggles array that have the name

    Declaration

    Swift

    public func setLocalValue(value: Bool, forToggleWithName name: String)

    Parameters

    name

    The name of the toggle that the caller is attempting to set the value of.

    value

    The value that the should be set locally for this toggle.