Contents

buildEither(second:)

Produces content for a conditional statement in a multi-statement closure when the condition is false.

Declaration

static func buildEither<F>(second: F) -> _ConditionalContent<_LimitedAvailabilityCompositorContent, F> where F : CompositorContent

Discussion

Conditional statements in a CompositorContentBuilder must contain both an if statement and an else statement, and the condition can only perform a compiler check for availability, like in the following code:

var body: some CompositorContent {
    if #available(visionOS 100, *) {
        MyNewContent()
    } else {
        MyOldContent()
    }
}