How can I handle incoming URLS in the new cross-platform swiftUI app

XCode 12 offers a new cross-platform swiftUI app - awesome
I would like to handle incoming URLs. How can I do this in the Cross Platform App?

(in 'old world' id implement os' appdelegate to do this)


Does App protocol provide any 'overrides' I didnt see?
OR
Can I somehow implement platform specific AppDelegates that then expose Environment? [same as openURLAction] but vice versa? :)]

Accepted Reply

Oho - I just found this https://developer.apple.com/documentation/swiftui/outlinesubgroupchildren/onopenurl%28perform:%29 .

Replies

Yeah, me too, I think this would nicely solve an issue I'm running into as well.

I want to be able to open windows in my WindowGroup from menu items and the like, ideally parameterized with a bit of data, and that seemed to dovetail nicely into handling deep and universal links (specifically, to things that are not Documents; DocumentGroup, while great, isn't quite appropriate here, and I already have a DocumentGroup scene in my app for other purposes)

Alas I wish I had thought of this yesterday when I had a lab on the topic of SwiftUI's App & DocumentGroup stuff.

I have a sinking feeling this might be a 2021 feature, though. :/
Oho - I just found this https://developer.apple.com/documentation/swiftui/outlinesubgroupchildren/onopenurl%28perform:%29 .
sounds nice. im a swiftui noob ;) how do I use it?
this a view modifier on app. got it