<!--
{
  "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(_:sortUsing:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11TableColumnVAA8ComparedQy_RszAA4TextVRs1_rlE_9sortUsing7contentACyxq_q0_AGG10Foundation23LocalizedStringResourceV_q_q0_xctcfc::OverloadGroup"
  },
  "title" : "init(_:sortUsing:content:)"
}
-->

# init(_:sortUsing:content:)

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

```
@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, sortUsing comparator: Sort, @ContentBuilder content: @escaping (RowValue) -> Content)
```

## Parameters

`titleResource`

Text resource for the column’s localized title.

`comparator`

The prototype sort comparator to use when representing
this column. When a person taps or clicks the column header,
the containing table’s `sortOrder` incorporates this value,
potentially with a flipped order.

`content`

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

## Discussion

This initializer creates a [`Text`](/documentation/SwiftUI/Text) view on your behalf.
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)