0

I have a TextEditor that i want to add a clickable Hyperlink using the TextEditor text.append()

TextEditor(text: $textE)
                    .textFieldStyle(.roundedBorder)

textE.append(contentsOf: "\n" + LINK......)

ozk
  • 1
  • 2

1 Answers1

0

I believe you have to use markdown to achieve hyperlink in text.

Text("Hello! Example of a markdown with a link [example](https://example.com)")

This question may be useful for you about how to use uitextview

JonathanLiu
  • 132
  • 1
  • 7
  • Error: Instance method 'append(contentsOf:)' requires that 'Text' conform to 'Sequence' – ozk May 19 '22 at 09:48
  • textE.append(contentsOf: Text("Hello! Example of a markdown with a link [example](https://example.com)")) – ozk May 19 '22 at 09:48
  • Um in this case, I just did something similar in swiftui. What I was trying to do is to add some hyperlink in between some normal text. It seems like swiftui doesn't have a very good way to achieve this. So I implement the UITextView from uikit. I added a link above, you can check it out. – JonathanLiu May 20 '22 at 06:41