How to add ellipsis inUITextView by the use of UITextPosition?

252 Views Asked by At

Is it possible to calculate the number of Visible characters in UITextView?there is possibility that the text in textview may be more or less than the size of UITextView..so I just want to truncate the last 3 visible characters and add ellipsis.. How to do it?

1

There are 1 best solutions below

3
On

you can do this by using UITextView Delegate -

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

here you can check for size and truncate the text.

But i don't think this is a good idea.