---
title: "buildEither(first:)"
framework: charts
role: symbol
role_heading: Type Method
path: "charts/chartcontentbuilder/buildeither(first:)"
---

# buildEither(first:)

Builds a partial result from a condition that’s true.

## Declaration

```swift
static func buildEither<T1, T2>(first: T1) -> BuilderConditional<T1, T2> where T1 : ChartContent, T2 : ChartContent
```

## Parameters

- `first`: The content to use if the condition is true.

## Discussion

Discussion This method provides support for if statements with an else clause and switch statements. It produces optional chart content that is visible when the condition evaluates to true.

## See Also

### Building conditionally

- [buildIf(_:)](charts/chartcontentbuilder/buildif(_:).md)
- [buildEither(second:)](charts/chartcontentbuilder/buildeither(second:).md)
