When should you use lineHeightMultiple vs. lineSpacing?

Note that there are subtle differences to using these parameters, even if you are effectively setting the same distances.

enter image description here

The above shows lineSpacing applied. When selecting text, the spacing is visible below the lines of text. The last spacing is truncated.

enter image description here

The above shows lineHeightMultiple applied. The selection shows the spacing is above the lines of text. The top spacing is NOT truncated.


Line Spacing is the distance in CGFloat between two lines.

Line Height Multiple the space between each line equal to the value multiply with the line height. Imagine Line Height Multiple = number of new lines for each line.

ie: lineHeightMultiple = 2 will insert 2 "\n" and lineHeightMultiple = 3 will insert "\n".

Tags:

Ios

Uikit