---
title: "buildIf(_:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/attachmentcontentbuilder/buildif(_:)"
---

# buildIf(_:)

Provides support for “if” statements in multi-statement closures, producing an optional view that is visible only when the condition evaluates to true.

## Declaration

```swift
static func buildIf<Content>(_ content: Content?) -> Content? where Content : AttachmentContent
```
