'Convert html links inside text to clickable links - SwiftUI
Is there any up to date way to convert links inside the text? I'm getting this kind of text from an API:
var someText: String = "with banks (for example to the sometimes controversial but leading exchange <a href="https://www.coingecko.com/en/exchanges/bitfinex">Bitfinex</a>)."
How can I convert that link inside to a clickable link with the proper name, in the example above: Bitfinex ?
The text could contain multiple links. SwiftUI now supports markdown, manually I could do it like:
Text("[Privacy Policy](https://example.com)")
but how do I do it for a received text from api with multiple links?
Looking for a Swift 5 & SwiftUI 3 solution.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
