<!--
{
  "availability" : [
    "iOS: 16.6.0 -",
    "iPadOS: 16.6.0 -",
    "macCatalyst: 16.6.0 -",
    "macOS: 13.5.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TableColumn/init(_:value:comparator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11TableColumnVAA10Foundation17KeyPathComparatorVyxGRs_AA4TextVRs1_rlE_5value10comparatorACyxAg2IGAD23LocalizedStringResourceV_s0fG0CyxSSGSSADE08StandardH0VtcAIRs0_rlufc::OverloadGroup"
  },
  "title" : "init(_:value:comparator:)"
}
-->

# init(_:value:comparator:)

Creates a sortable column that displays a string property, and
generates its label from a localized string resource.

```
@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, value: KeyPath<RowValue, String>, comparator: String.StandardComparator = .localizedStandard) where Content == Text
```

## Parameters

`titleResource`

Text resource for the column’s localized title.

`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`](/documentation/SwiftUI/Text) view for you.
For more information about localizing strings, see [`Text`](/documentation/SwiftUI/Text).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)