Contents

init(_:sortUsing:content:)

Creates a sortable column that generates its label from a localized string resource.

Declaration

@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, sortUsing comparator: Sort, @ContentBuilder content: @escaping (RowValue) -> Content)

Parameters

  • titleResource:

    Text resource for the column’s localized title.

  • comparator:

    The prototype sort comparator to use when representing this column. When a person taps or clicks the column header, the containing table’s sortOrder incorporates this value, potentially with a flipped order.

  • content:

    The view content to display for each row in a table.

Discussion

This initializer creates a Text view on your behalf. For more information about localizing strings, seeText.

See Also

Creating a sortable column