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 | More toots from dimsumthinking@mastodon.social
@dimsumthinking I'm annoyed that I can't just do ForEach( myArray ) { someItem in ...
(i.e. "annoyed, regardless of whatever the good reason for it is")
=> More informations about this toot | More toots from shayman@cosocial.ca This content has been proxied by September (3851b).Proxy Information
text/gemini