mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Fix bug with placeholder text not disappearing
This commit is contained in:
parent
0b02903b26
commit
3b31f36a03
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user