Interesting. For you first question, if the size class should be used for device rotation, it depends on your use case.

Getting rotation via UIDevice.current.orientation.isLandscape will always be the actual, physical rotation of the device. You might use this data to adjust the gyroscope or the camera, like something more related to real-life interactions.

Size classes are different, especially on iPadOS.

On iPadOS, the size classes of full-screen portrait and landscape are the same. You can even have split-screen.

That’s why size classes are better for adjusting the user interface, as physical rotation doesn’t accurately represent the size of the screen displayed for your app (for example, your iPad can be landscape physically, but your app can be running in split screen).

For your second question, I’m not completely sure, but I think .onOpenURL (not the @Environment) is the most reliable way of opening an app from an email link.

@Environment(\.importFiles), as the name suggests, is for importing files.

Then, @Environment(\.openURL), is for displaying a URL, not receiving the URL the made the app launch. You’re supposed to use it as a result of a user action (for example, press a button, then open Settings).

Here’s some more info on it. Anyway, thanks for your questions! They were very intriguing.

I like reading manga and writing about Swift. Check out my app, Find — look for text in real life, with outrageous speed.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store