Instance Property


The maximum number of lines to use for rendering text.


@property(nonatomic) NSInteger numberOfLines;


This property controls the maximum number of lines to use in order to fit the label’s text into its bounding rectangle. The default value for this property is 1. To remove any maximum limit, and use as many lines as needed, set the value of this property to 0.

If you constrain your text using this property, any text that does not fit within the maximum number of lines and inside the bounding rectangle of the label is truncated using the appropriate line break mode, as specified by the lineBreakMode property.

When the label is resized using the sizeToFit method, resizing takes into account the value stored in this property. For example, if this property is set to 3, the sizeToFit method resizes the receiver so that it is big enough to display three lines of text.

See Also

Sizing the Label’s Text


A Boolean value indicating whether the font size should be reduced in order to fit the title string into the label’s bounding rectangle.


A Boolean value indicating whether the label tightens text before truncating.


Controls how text baselines are adjusted when text needs to shrink to fit in the label.


The minimum scale factor supported for the label’s text.


A Boolean value indicating whether spacing between letters should be adjusted to fit the string within the label’s bounds rectangle.


The size of the smallest permissible font with which to draw the label’s text.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software