I want to restrict my textview to 50 characters. I did it, but I am unable to press backspace after 50 characters. How to solve the problem ? My code is as below (Note: 'txtv' is my textview name)
func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool {
if (self.txtv.text.characters.count) >= 50 {
return false
}
return true
}