---
title: LibraryContentBuilder
framework: developertoolssupport
role: symbol
role_heading: Structure
path: developertoolssupport/librarycontentbuilder
---

# LibraryContentBuilder

A function builder for generating arrays of library items without requiring full array literal syntax.

## Declaration

```swift
@resultBuilder struct LibraryContentBuilder
```

## Overview

Overview Use the library content function builder to simplify the implementation of protocol requirements from you which provide arrays of library items. For example, without the builder, you would have to explicitly put items in an array in a views implementation: struct LibraryViewContent: LibraryContentProvider {     var views: [LibraryItem] {         [             LibraryItem(MyFirstView()),             LibraryItem(MySecondView())         ]     } } With the builder, you can omit the array literal syntax: struct LibraryViewContent: LibraryContentProvider {     @LibraryContentBuilder     var views: [LibraryItem] {         LibraryItem(MyFirstView())         LibraryItem(MySecondView())     } } In practice, the Swift compiler infers the need for a library content builder attribute and adds it at build time, so that you never need to explicitly write the attribute in your code, even though it’s technically in use: struct LibraryViewContent: LibraryContentProvider {     var views: [LibraryItems] {         LibraryItem(MyFirstView())         LibraryItem(MySecondView())     } }

## Topics

### Type Methods

- [buildBlock(_:)](developertoolssupport/librarycontentbuilder/buildblock(_:).md)
- [buildExpression(_:)](developertoolssupport/librarycontentbuilder/buildexpression(_:)-8x2oz.md)
- [buildExpression(_:)](developertoolssupport/librarycontentbuilder/buildexpression(_:)-90ip4.md)
