I am using UITextView and implemented the delegate function
var count = 0
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
print(text)
count += 1
print(count)
return true
}
sample
When i select the predictive text from the Keyboard, shouldChangeTextInRange delegate is calling twice.
- Why this delegate calling twice?
- Why this happening with predictive text alone