I need to limit the number of lines in a UITextView to 2 and add ellipses to any overflowing text. How can I do it? For some implementation reasons, I cannot use UILabel .
UITextView
UILabel
You can do this by setting the textContainer properties as follows:
textContainer
textView.textContainer.maximumNumberOfLines = 2 textView.textContainer.lineBreakMode = .byTruncatingTail