I have taken UIlabel which are generated dynamically using for loop, each type diff text is assign in label, I want to give UILabel size dynamically depending on text.
myLabel.text = "Your Label Text Here" myLabel.textAlignment = .Natural myLabel.numberOfLines = 0 myLabel.sizeToFit() myLabel.frame = CGRectMake(myLabel.frame.origin.x, myLabel.frame.origin.y, 280, myLabel.frame.height)