Ch. 9: Where are EnvironmentValues' possible values documented?

I see lists of EnvironmentValues documented online, 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?

I usually start with the documentation at Apple Developer Documentation on EnvironmentValues. From there you can drop down into the individual types and then the options.

1 Like

I do see lists of EnvironmentValues documented online, but not the possible values each one can be set to. For example, where in Apple Developer Documentation on EnvironmentValues do you see documentation that .compact and .regular are possible values for verticalSizeLimit? Can you post a screenshot showing documentation referring to .compact or .regular or any of a different EnvironmentValue’s possible values, and not just the EnvironmentValue itself?

On the page I linked, click on an environment value. Say verticalSizeClass. That will take you to the documentation for that property. For almost every one, you’ll see a link to the type in the Declaration:

From there you can go into the UserInterfaceSizeClass enumeration and you’ll see the possible values, in this case under the Topics heading.

Like too much Apple documentation, it is a bit more work than it should be, but it’s the most consistent way that I’ve found to find the options for the values.

1 Like

Yes, it looks like there’s no set pattern to get you to a list of an EnvirnomentValue’s possible values.