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

# init(_:value:comparator:content:)

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

```
nonisolated init(_ titleKey: LocalizedStringKey, value: KeyPath<RowValue, String>, comparator: String.StandardComparator = .localizedStandard, @ContentBuilder content: @escaping (RowValue) -> Content)
```

## Parameters

`titleKey`

The key for the column’s localized title.

`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 `Text/init(_:tableName:bundle:comment:)`. See
`Text` for more information about localizing strings.

---

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)