How To Open Apple Maps From An Address In SwiftUI

In an iOS app I am working on I need to show a map from an address.

But after researching and asking some questions I was able to get it to work.

I must admit I struggled quite a bit with how to show an alert if the address string was invalid In hindsight, the solution is pretty straightforward. It comes down to just Observing a published property in an Observable Object Class.

--

--

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