1

I have a UILabel in a cell, and I am setting attributed text in it. It attributed text is too large than it should come with ... at the end. How to do that ?

2 Answers 2

3
func addTitle(title: String) { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineBreakMode = .byTruncatingTail let attributedTitle = NSAttributedString(string: title, attributes: [NSParagraphStyleAttributeName: paragraphStyle]) self.titleLabel.attributtedString = attributedTitle } 
Sign up to request clarification or add additional context in comments.

Comments

-1

In addition to the above answers, maybe you forgot adding a trailing constraint to your UILabel or it's parent view.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.