One Logo Pool Ball
SwiftUI · IOS API REFERENCE

TableColumnContent

protocol · iOS 16.0+ · SDK 27.1

@MainActor @preconcurrency protocol TableColumnContent<TableRowValue, TableColumnSortComparator>

A type used to represent columns within a table. This type provides the body content of the column, as well as the types of the column's row values and the comparator used to sort rows. You can factor column content out into separate types or properties, or by creating a custom type conforming to `TableColumnContent`. var body: some View { Table(people, selection: $selectedPeople, sortOrder: $sortOrder) { nameColumns TableColumn("Location", value: \.location) { LocationView($0.location) } } } @TableColumnBuilder<Person, KeyPathComparator<Person>> private var nameColumns: some TableColumnContent< Person, KeyPathComparator<Person> > { TableColumn("First Name", value: \.firstName) { PrimaryColumnView(person: $0) } TableColumn("Last Name", value: \.lastName) TableColumn("Nickname", value: \.nickname) } The above example factors three table columns into a separate computed property that has an opaque type. The property's primary associated type `TableRowValue` is a `Person` and its associated type `TableColumnSortComparator` is a key comparator for the `Person` type. A type conforming to this protocol inherits `@preconcurrency @MainActor` isolation from the protocol if the conformance is included in the type's base declaration: struct MyCustomType: Transition { // `@preconcurrency @MainActor` isolation by default } Isolation to the main actor is the default, but it's not required. Declare the conformance in an extension to opt out of main actor isolation: extension MyCustomType: Transition { // `nonisolated` by default }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

TableColumnContent.defaultVisibility(_:)

This protocol needs associated types that cannot yet cross the bridge.

TableColumnContent.customizationID(_:)

This protocol needs associated types that cannot yet cross the bridge.

TableColumnContent.disabledCustomizationBehavior(_:)

This protocol needs associated types that cannot yet cross the bridge.

TableColumnContent.alignment(_:)

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUI types →