SwiftyMarkdown
SwiftyMarkdown copied to clipboard
support with swiftui
hello, can this support in swift UI, and do you have a sample ?
You can use any implementation of UIViewRepresentable. Here is simple one
struct UIKTextView: UIViewRepresentable {
@Binding var text: NSAttributedString
func makeUIView(context: Context) -> UITextView {
UITextView()
}
func updateUIView(_ uiView: UITextView, context: Context) {
uiView.attributedText = text
}
}
And then
UIKTextView(text: .constant(SwiftyMarkdown(string: "some **bold** markdown text").attributedString()))