Toggler
public class Toggler
Undocumented
-
Getter/Setter for this
Toggle
object’s local override. When setting this value it will write toUserDefaults
using thedefaultsKey
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’svalue
. Must use this getter asname
is markedinternal
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’svalue
. Must use this setter asToggler.init()
is markedinternal
for API purposes. Calling this function will remove all duplicateToggle
objects based on thename
that is passed in.Complexity
O(n) where n is the number of
Toggle
objects inside thetoggles
array that have thename
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’slocalValue
. Must use this setter asToggler.init()
is markedinternal
for API purposes.Complexity
O(n) where n is the number of
Toggle
objects inside thetoggles
array that have thename
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.