iOS 14 and SwiftUI - Giving your app a custom URL scheme

One thing you might want to give your iOS app is custom URL scheme so people can interact with your app.

You might find this hard in iOS 14 and newer if you using the new app creation method which has no AppDelegate.swift and instead has a main decorator.

If you search the internet you’ll see a lot of people suggesting basically plumping in a AppDelegate. I’m not sure that’s the preferred approach. Instead, fortunately, Donny Wals has pointed out that there’s an onOpenURL method. I feel this is better and likely the way forward. There may still be reasons to plump in an AppDelegate but equally if you’re going to go down that route you may want to simply create your project with the older project format.