Markdown in SwiftUI Text
Reading time: 1 min
This recipe shows how to use markdown in SwiftUI Text views. The end result looks like this:
This code works starting with SwiftUI 3 (iOS 15, macOS 12). If you're interested in using attributed strings on SwiftUI 1 and 2, check out Text with NSAttributedString recipe or Hyperlinks with Te...
SwiftUI Text with HTML via NSAttributedString
Reading time: 8 min
This recipe shows how to format content of a SwiftUI Text
with HTML via NSAttributedString
on any SwiftUI version. The end result looks like this:
There are two solutions in this recipe:
- SwiftUI 3 (iOS 15, macOS 12) brings in a new
AttributedString
wrapper aroundNSAttributedString
...