0

So I'm trying to make a Text link clickable. I can get it working if I hardcode the link, but if I replace it with a variable it no longer become clickable.

What I've tried so far

if let obtainedFrom = project.obtainedFrom {
    if let obtainedFromURL = project.obtainedURL {
        Text("Obtained From URL: [\(obtainedFrom)](\(obtainedFromURL))") // Not clickable
        Text("Obtained From URL: [\(obtainedFrom)](https://news.google.com)") // Works
        
        Text("Obtained From URL: \(obtainedFrom) - \(obtainedFromURL)")
    } else {
        Text("Obtained From: \(obtainedFrom)")
    }
}
koen
  • 5,383
  • 7
  • 50
  • 89
Ceri Turner
  • 830
  • 2
  • 12
  • 36
  • Does this answer your question? https://stackoverflow.com/questions/68426768/swiftui-text-markdown-dynamic-string-not-working – jnpdx Apr 15 '23 at 22:39

0 Answers0