Nandish A Nandish A - 2 months ago 10
Objective-C Question

Is SizeThatFits call necessary for a fixed width and height UILabel

If I set my UILabel frame to a fixed width, number of lines to 1 and set

lineBreakMode = NSLineBreakByTruncatingTail


Should I still call
sizeThatFits
to reframe the UILabel.

Answer

if you set fix height and width constraint then your label's size will not change. It will be fix as constant of your constraints. so, sizeThatFits has no meaning in that case!!