-
-
Save sturdysturge/6b6995f0e3cef6ae844aeedab6017668 to your computer and use it in GitHub Desktop.
LinkView
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
struct LinkView: View { | |
let urlString = "https://medium.com/better-programming/the-complete-swiftui-documentation-youve-been-waiting-for-fdfe7241add9" | |
var body: some View { | |
Group { | |
if let url = URL(string: urlString) { | |
//The new way to create a Link | |
Link("Read more", destination: url) | |
} | |
else { | |
EmptyView() | |
.onAppear { assertionFailure("URL was nil") } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment