Where are EnvironmentValues' possible values documented?

n00b here. I see lists of EnvironmentValues documented, but not the possible values each one can be set to. For example, verticalSizeLimit can be .compact and .regular, but where are .compact and .regular documented in relation to verticalSizeLimit. Aside from Bools, where are EnvironmentValues' possible values documented?

Answered by Claude31 in 705361022

Does autoCompletion provide you with the list of possible values ?

You'll get the list here:

https://developer.apple.com/documentation/swiftui/environmentvalues

You can add new ones, with extensions:

https://useyourloaf.com/blog/swiftui-custom-environment-values/

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?

Accepted Answer

Does autoCompletion provide you with the list of possible values ?

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.

Where are EnvironmentValues' possible values documented?
 
 
Q