I found this problem as well.
My solution is not very elegant, I'm afriad. I had to be very specific about the types. I moved the columns into their own @TableColumnBuilder with all the generics specified:
@TableColumnBuilder<Weather.State.Row, Never>
private var columns: TupleTableColumnContent<
Weather.State.Row, Never, (
TableColumn<Weather.State.Row, Never, Text, Text>,
TableColumn<Weather.State.Row, Never, Text, Text>,
TableColumn<Weather.State.Row, Never, Text, Text>,
TableColumn<Weather.State.Row, Never, Text, Text>,
TableColumn<Weather.State.Row, Never, Text, Text>,
TableColumn<Weather.State.Row, Never, Text, Text>
)
> {
TableColumn("Local Date/Time", value: \.dateTime)
TableColumn("Temperature", value: \.temp)
TableColumn("Apparent Temperature", value: \.apparentTemp)
TableColumn("Dew Point", value: \.dewPoint)
TableColumn("Humidity", value: \.humidity)
TableColumn("Rain", value: \.rain)
}
Though this is a lot of ugly specificity, it's the type inference that slowing Swift down here.
I was lucky because I don't need a sort comparator (hence the Never above) and all my labels and views are simply Texts.
There may be a way to clean this up further with buildPartialBlock
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: