init(_:sortUsing:content:)
Creates a sortable column with text label.
Declaration
nonisolated init(_ text: Text, sortUsing comparator: Sort, @ViewBuilder content: @escaping (RowValue) -> Content)Parameters
- text:
The column’s label.
- comparator:
The prototype sort comparator to use when representing this column. When a person taps or clicks the column header, the containing table’s
sortOrderincorporates 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 for you, and treats the title similar to init(_:). For more information about localizing strings, see Text.