Initializer

init(_:sortUsing:content:)

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

Declaration 宣言

init<S>(_ title: S, sortUsing comparator: Sort, content: @escaping (RowValue) -> Content) where S : StringProtocol
Available when RowValue conforms to Identifiable, RowValue is Sort.Compared, Sort conforms to SortComparator, Content conforms to View, and Label is Text.

Parameters パラメータ

title

A string that describes the column.

comparator

The prototype sort comparator to use to represent this column. On click of the column header, this will be incorporated into the containing table’s sortOrder, 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, and treats the title similar to init(_:). See Text for more information about localizing strings. このイニシャライザは、Textビューをあなたの代わりに作成します、そしてタイトルをinit(_:)と同じように扱います。Textを文字列のローカライズについてのさらなる情報として見てください。

See Also 参照

Creating a Column with a Comparator