Replies: 1 comment
-
Hi @nhereveri, SwiftUI provides that functionality out of the box. You can implement a custom Markdown {
"""
Visit the [terms](https://www.example.com) and [conditions](https://apple.com).
"""
}
.environment(\.openURL, OpenURLAction { url in
// Modify a state, execute an action, etc., based on 'url'
return .handled
}) For example, the companion Demo application uses this technique to scroll to the appropriate heading in the view when the user taps on an anchored link instead of opening the link in the browser. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Could you implement a functionality that allows InlineLink (or some other new element) to execute actions instead of just linking to URLs (such as opening another specific view or modifying a state)?
The idea is not to use a custom scheme and then use NavigationLink because I need to create them within Markdown. For example, when creating a single paragraph with two links to different views (as happened with a client who needed the terms and conditions in the same text along with the privacy policies).
Beta Was this translation helpful? Give feedback.
All reactions