Replies: 1 comment 1 reply
-
Hi @lan680 I'm happy to hear that you like it! ...but I'm not sure how this relates to RichTextKit? 🤔 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Love RichTextKit! It has been working greatly.
Just trying to add the partial text selection function, but we are running to the compatibility issue - the rich text string becomes inconsistent due to compatibility issues between
UITextView
and SwiftUI, and theUITextView
exhibits unusual behavior with respect to its width.The code used is the following -
struct SelectableTextView: UIViewRepresentable {
let text: String
func makeUIView(context: Context) -> UITextView {
let textView = UITextView()
textView.isEditable = false
textView.isSelectable = true
textView.text = text
textView.font = UIFont.systemFont(ofSize: 17)
return textView
}
func updateUIView(_ uiView: UITextView, context: Context) {
uiView.text = text
}
}
Any suggestion or guidance will be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions