diff --git a/iOS/PostEditor/PostBodyTextView.swift b/iOS/PostEditor/PostBodyTextView.swift index 3ab791e..609533e 100644 --- a/iOS/PostEditor/PostBodyTextView.swift +++ b/iOS/PostEditor/PostBodyTextView.swift @@ -29,10 +29,6 @@ class PostBodyCoordinator: NSObject, UITextViewDelegate, NSLayoutManagerDelegate } } - func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { - return true - } - func textViewDidEndEditing(_ textView: UITextView) { self.isFirstResponder = false self.didBecomeFirstResponder = false @@ -97,7 +93,9 @@ struct PostBodyTextView: UIViewRepresentable { } func updateUIView(_ uiView: UITextView, context: UIViewRepresentableContext) { - uiView.text = text + if uiView.text != text { + uiView.text = text + } let font = textStyle let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle) diff --git a/iOS/PostEditor/PostTitleTextView.swift b/iOS/PostEditor/PostTitleTextView.swift index 60017e8..705bcf4 100644 --- a/iOS/PostEditor/PostTitleTextView.swift +++ b/iOS/PostEditor/PostTitleTextView.swift @@ -112,7 +112,9 @@ struct PostTitleTextView: UIViewRepresentable { } func updateUIView(_ uiView: UITextView, context: UIViewRepresentableContext) { - uiView.text = text + if uiView.text != text { + uiView.text = text + } let font = textStyle let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle)