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
func addTitle(title: String) { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineBreakMode = .byTruncatingTail let attributedTitle = NSAttributedString(string: title, attributes: [NSParagraphStyleAttributeName: paragraphStyle]) self.titleLabel.attributtedString = attributedTitle }