swift uilabel dynamic height based on text length

239

let myLabel = UILabel()
// Set leading and trailing constraints, and either top/bottom constraint,
//   likely done within Storyboard
myLabel.numberOfLines = 0
myLabel.sizeToFit()

Comments

Submit
0 Comments