When I set a UILabel as 0 number of rows, I understand that it causes the label to increase in number of rows based on the length of the text. Is there a way to set the maximim nuber of rows so that when the text is longer than the label allows, it shows an ellipses and limits the number of rows to the maximum set? For example, if I set the maximum number of rows to 3, then if the label needs 4 rows in order to show the entire text, it instead shows only 3 rows and shows an ellipses at the bottom right-hand side of the label to indicate that the text can't fit.
Have you bothered to read the documentation? To quote:
"
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."
The default linebreak mode is to truncate the end and add ellipses. That's what you're asking for.