I tried the first suggestion from robnotyou, and it seems to work without any unpleasant side effect. After voting it as the answer, the system won't let me also choose the other answer from Claude31.
I've studied Claude31's answer and the info at the other thread, and I see it addresses my situation exactly. It was good to study to understand why my error happens in the first place, even if I don't yet fully understand this intricacy yet. I do want to ask: since the first solution is a lot simpler, does it risk any bad side effects somewhere along the line? I mean, why implement a stateful preview wrapper if you can just coerce the thing to preview into a constant via .constant()?
Post
Replies
Boosts
Views
Activity
The error is, " "Cannot convert value of type 'Thing' to expected argument type 'Binding'". "
Yes, that fixes it, thanks. As a beginner, though, I still don't understand the solution, so I'll study that documentation.
I did look up "stride" in Xcode's documentation before posting, but it showed me stride entries that gave very little information and did not fit this use with Array. Googling "swift array stride," I was led to searching the documentation for "stride(from:to:by:)," so I'm apparently a n00b at reading the manual, too, which is not normally the case, I assure you.
I would like to continue to ask, though: why does ForEach(1..<31) work, but ForEach(1...31) fails?
Ha! Of course it does. Why didn't I think of that? I told you it was a n00b question. Thanks.
Still, it's weird that I can't find the possible values listed in their own documentation somewhere.
Yes, that's one of the lists of EnvironmentValues that I've seen. But I don't see anywhere in that documentation the possible values that each EnvironmentValue can be set to.
For example, verticalSizeLimit can be .compact and .regular, but where are .compact and .regular documented on the page you linked to?