Rewriting my SwiftUI book. I hate that this no longer works even for a constant array:
ForEach(myArray.indices)
The warning is "non constant range". This range IS constant.
The second half of the warning is: "argument must be an integer literal"
It seems we. should be able to mark it as constant so that the compiler is satisfied.
If the view includes the value
let x = myArray.count
Then ForEach(0..<x) still doesn't work even though it is provably a constant range.
=> More informations about this toot | View the thread | More toots from dimsumthinking@mastodon.social
text/gemini
This content has been proxied by September (ba2dc).