Contents

init(_:value:comparator:content:)

Creates a sortable column with a text label.

Declaration

init(_ text: Text, value: KeyPath<RowValue, String>, comparator: String.StandardComparator = .localizedStandard, @ViewBuilder content: @escaping (RowValue) -> Content)

Parameters

  • text:

    The column’s label.

  • value:

    The path to the property associated with the column, used to update the table’s sorting state.

  • comparator:

    The specific comparator to compare string values.

  • content:

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

Discussion

This initializer creates a Text view on your behalf, and treats the localized key similar to init(_:tableName:bundle:comment:). See Text for more information about localizing strings.

See Also

Creating a sortable column