How to show HTML or Markdown in a SwiftUI Text?

后端 未结 5 1520
孤城傲影
孤城傲影 2020-12-31 12:39

How can I set a SwiftUI Text to display rendered HTML or Markdown?

Something like this:

Text(HtmlRenderedString(fromString: \"

        
5条回答
  •  旧时难觅i
    2020-12-31 13:21

    Text can just display Strings. You can use a UIViewRepresentable with an UILabel and attributedText.

    Probably attributedText text support will come later for SwiftUI.Text.

提交回复
热议问题