Created
October 29, 2019 08:29
-
-
Save wongjustin99/154c2144113648869349b8a2e38eb2e9 to your computer and use it in GitHub Desktop.
SwiftUI open URL link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func swiftUIUrl(link: String, linkText: String) -> some View { | |
Button(action: { | |
let myUrl = link | |
let url: NSURL = URL(string: myUrl)! as NSURL | |
UIApplication.shared.open(url as URL) | |
}){ | |
Text(linkText) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment