ObjcLDMultiContextBuilder
@objc(LDMultiContextBuilder)
public final class ObjcLDMultiContextBuilder : NSObject
Contains method for building a multi-context.
Use this type if you need to construct a LDContext that has multiple kind values, each with its
own nested LDContext. To define a single-kind context, use LDContextBuilder
instead.
Obtain an instance of LDMultiContextBuilder by calling LDMultiContextBuilder.init()
; then, call
LDMultiContextBuilder.addContext(_:)
to specify the nested LDContext for each kind.
LDMultiContextBuilder setters return a reference the same builder, so they can be chained
together.
-
Undocumented
Declaration
Swift
public override init()
-
Adds a nested context for a specific kind to a LDMultiContextBuilder.
It is invalid to add more than one context with the same Kind. This error is detected when you call
LDMultiContextBuilder.build()
.Declaration
Swift
@objc public func addContext(context: ObjcLDContext)
-
Creates a LDContext from the current properties.
The LDContext is immutable and will not be affected by any subsequent actions on the LDMultiContextBuilder.
It is possible for a LDMultiContextBuilder to represent an invalid state. In those situations, a Result.failure will be returned.
If only one context kind was added to the builder,
build
returns a single-kind context rather than a multi-context.Declaration
Swift
@objc public func build() -> ContextBuilderResult