Fix bug with placeholder text not disappearing

This commit is contained in:
Angelo Stavrow 2020-11-11 10:36:32 -05:00
parent 0b02903b26
commit 3b31f36a03
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -23,12 +23,17 @@ class PostBodyCoordinator: NSObject, UITextViewDelegate, NSLayoutManagerDelegate
self.lineSpacingMultiplier = lineSpacingMultiplier self.lineSpacingMultiplier = lineSpacingMultiplier
} }
func textViewDidChange(_ textView: UITextView) {
DispatchQueue.main.async {
self.postBodyTextView.text = textView.text ?? ""
}
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
return true return true
} }
func textViewDidEndEditing(_ textView: UITextView) { func textViewDidEndEditing(_ textView: UITextView) {
self.postBodyTextView.text = textView.text ?? ""
self.isFirstResponder = false self.isFirstResponder = false
self.didBecomeFirstResponder = false self.didBecomeFirstResponder = false
} }