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.