Great question!

First, how to get the link that the app was launched from, if any.

Answer: Inside your App struct, implement the .onOpenURL view modifier on ContentView:

Image for post
Image for post
Image for post
Image for post
Left: when launched from a link. Right: when launched directly from the home screen.

Second, how to monitor device rotation

Answer: There’s a lot of ways to do this, but the easiest is to use a notification publisher. Here’s what ContentView will look like:

Source from Koraktor’s great Stack Overflow answer
Image for post
Image for post

I like reading manga and writing about Swift. Check out my app, Find — search text in real life! apple.co/3jFUFvt

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