You can do this using Markdown Text, a custom url scheme, and .onOpenUrl
modifier:
struct ContentView: View {
let text1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin imperdiet ipsum purus, sit amet mollis nunc "
let text2 = "bibendum eget."
let text3 = " Nulla suscipit mauris non diam varius sagittis. Ut feugiat imperdiet bibendum. Vestibulum dui quam, bibendum sit amet imperdiet sit amet, dapibus sit amet mauris."
@State private var path = NavigationPath()
var body: some View {
NavigationStack(path: $path) {
VStack {
Text(text1) +
Text("[\(text2)](myappurl://action)").bold() +
Text(text3)
}
.padding()
.onOpenURL { url in
path.append(1)
}
.navigationTitle("Main")
.navigationDestination(for: Int.self) { value in
Text(value, format: .number)
}
}
}
}
See my answer here for full details on how to configure the url scheme.
