I tried your code with Xcode 3.1 and got the following error:
(I needed to fill many parts missing in your shown code, so some other parts still hidden may be affecting.)
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
The error is far from kind enough for fixing the issue, but it may very often caused by some obvious syntax errors in a ViewBuilder.
As far as I check the code, this line is obviously odd:
TableColumn("disc", Int: \.discNumber)
TableColumn does not have an initializer init(_:Int:).
And any initializers of TableColumn taking a KeyPath to Int requires RowValue as NSObject.
So, a simple workaround may be defining an extension which return String.
extension AlbumTracks {
var discNumberString: String {
String(discNumber)
}
}
And use it as follows:
TableColumn("disc", value: \.discNumberString)
But as already noted, other parts may be affecting. If this workaround does not work, you may need to show more info.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: