Flag Change Observers
-
An object can own an observer for as long as the object exists. Swift structs and enums cannot be observer owners.
Declaration
Swift
public typealias LDObserverOwner
-
Collects the elements of a feature flag that changed as a result of the SDK receiving an update.
The SDK will pass a LDChangedFlag or a collection of LDChangedFlags into feature flag observer closures. See
See moreLDClient.observe(key:owner:handler:)
,LDClient.observe(keys:owner:handler:)
, andLDClient.observeAll(owner:handler:)
for more details.Declaration
Swift
public struct LDChangedFlag
-
A closure used to notify an observer owner of a change to a single feature flag’s value.
Declaration
Swift
public typealias LDFlagChangeHandler = (LDChangedFlag) -> Void
-
A closure used to notify an observer owner of a change to the feature flags in a collection of
LDChangedFlag
.Declaration
Swift
public typealias LDFlagCollectionChangeHandler = ([LDFlagKey : LDChangedFlag]) -> Void
-
A closure used to notify an observer owner that a feature flag request resulted in no changes to any feature flag.
Declaration
Swift
public typealias LDFlagsUnchangedHandler = () -> Void