Toot

Written by dimsumthinking on 2024-12-31 at 01:34

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

Mentions

Tags

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113744862798874918
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
217.921359 milliseconds
Gemini-to-HTML Time
0.752559 milliseconds

This content has been proxied by September (ba2dc).