How to limit max width of UILabel?

If you are using constraints then remove all constraints from you label.

enter image description here

Then again set frames of your label and if you want to make multiline label, then simply set the number of lines from 1 to 0 and increase the height of your label.

enter image description here

OR

If you want to fit your text within the label.You can simply enable Autoshrink property.

enter image description here


Give the label a <= constraint like this:

enter image description here


use following code and set your width in boundingRectWithSize value.

CGSize itemTextSize = [@"Your Text" boundingRectWithSize:CGSizeMake(100, 30) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont fontWithName:@"Helvetica Neue" size:12.5]} context:nil].size;