Contents

init(_:value:comparator:)

Creates a sortable column that displays a string property and has a text label.

Declaration

init(_ text: Text, value: KeyPath<RowValue, String>, comparator: String.StandardComparator = .localizedStandard) where Content == Text

Parameters

  • text:

    The column’s label.

  • value:

    The path to the property associated with the column, to display verbatim as text in each row of a table, and the key path used to create a sort comparator when sorting the column.

  • comparator:

    The SortComparator used to order the string values.

Discussion

This initializer creates a Text view for you, and treats the title similar to init(_:). For more information about localizing strings, see Text.

See Also

Creating a sortable column