I would like a text similar to Twitter’s
I am currently using a UITextView since it has multi-line support. I kind of figured out how to use a label that counts the characters and keeps the user up to date of any characters added or removed.
Empty:

With Text:

The problem I am having however is when I copy or paste any text in the view, (like if I highlight all the text, as in the second picture) and I delete it, the counter will not update. Or if I paste any text, the count just decrements one character, though the text field limit still stays correct, just the counter is no longer in sync with it.
There is a delegate method for UITextView as
it is called every time a character is inserted into the UITextView. In this method set the length of text in your counter UILabel as follows
return YES at the end of method if the length is within range i.e. less than or equal to 140 else return NO.
UPDATE:..
To restrict to 140 characters.
To handle text removal on selection and counting characters.