I have a UILabel in my cell subclass, which supposedly should contain a header. The size of the header can be of different lengths, and therefore I need to resize the UILabel so that it matches the text and so that the text is not long, I also need to set maxHeight. The width should be the same. How to create such code in swift in a subclass of tableViewCell?
While I have it in awakeFromNib
theTitleLabel?.font = UIFont(name: "HelveticaNeue", size: 13) theTitleLabel?.textColor = UIColor(rgba: "#4F4E4F") theTitleLabel?.numberOfLines = 0 theTitleLabel?.lineBreakMode = NSLineBreakMode.ByTruncatingTail
source share