buildExpression
TypeScriptstatic buildExpression(item: LibraryItem): Array<LibraryItem>Swift declarationstatic func buildExpression(_ item: LibraryItem) -> [LibraryItem]struct · iOS 14.0+ · SDK 27.1
@resultBuilder struct LibraryContentBuilderA function builder for generating arrays of library items without requiring full array literal syntax. 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 ``LibraryContentProvider/views-25pdm`` 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()) } }
static buildExpression(item: LibraryItem): Array<LibraryItem>Swift declarationstatic func buildExpression(_ item: LibraryItem) -> [LibraryItem]static buildExpression84173(items: Array<LibraryItem>): Array<LibraryItem>Swift declarationstatic func buildExpression(_ items: [LibraryItem]) -> [LibraryItem]1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
LibraryContentBuilder.buildBlock(_:)
A variable number of Swift arguments is not supported.