Seems to be a compiler bug -- https://github.com/apple/swift/issues/60900
Post
Replies
Boosts
Views
Activity
One way to this is to use multiple TableColumnBuilder objects.
Using Group removes the ability to sort via the column headers, and fancy column customization was failing for me too. TableColumnBuilders also create more easily organized code.
https://developer.apple.com/documentation/swiftui/tablecolumnbuilder/
@TableColumnBuilder<ObjectType, KeyPathComparator<ObjectType>>
var tableColumns1: some TableColumnContent<ObjectType, KeyPathComparator<ObjectType>> {
TableColumn(
...
Table(of: ObjectType.self, selection: $selection, sortOrder: $sortOrder, columnCustomization: $columnCustomization) {
tableColumns1
tableColumns2
tableColumns3
} rows: {
ForEach(filteredCompositions) { obj in
TableRow(obj)
}
}