Skip to content

Comments

yvl: leverage native SwiftUI link support#28

Open
yensi-vega wants to merge 1 commit intodasautoooo:mainfrom
yensi-vega:yvl-add-support-to-inline-links
Open

yvl: leverage native SwiftUI link support#28
yensi-vega wants to merge 1 commit intodasautoooo:mainfrom
yensi-vega:yvl-add-support-to-inline-links

Conversation

@yensi-vega
Copy link

As there is no way to use the onTapGesture I found a way to leverage the native SwiftUI link rendering in a Text component.

linkElementComposer.destination.map {
   // Update foundCharacters with an embedded link to leverage SwiftUI handle it
  context.foundCharacters = "[\(context.foundCharacters)](\($0))"

}
We re-build the link so the Text SwiftUI component renders it as a link and also reacts to it by opening an external browser with the provided url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant