class MojoCell :UITableViewCell{ // cell for Mojo
@IBOutlet weak var height: NSLayoutConstraint!
@IBOutlet weak var qNumber: UILabel!
@IBOutlet weak var question: UILabel!
@IBOutlet weak var answer: UISegmentedControl!
func configure(_ mojo: MojoModel) {
self.qNumber.text = mojo.questionNumber
let text :String = "123456789-123456789-123456789-1234567889-123456789"
self.question.sizeToFit()
question.numberOfLines = 0
question.lineBreakMode = NSLineBreakMode.byWordWrapping
question.text = text
question.sizeToFit()
}
I used the above code to adjust the height of the label according to the content of the UIlabel. But It does not work I expected. It only shows the portion of the text.