convert sketch line height into ios line 'height multiple' property

Mukesh Gami picture Mukesh Gami · Jun 16, 2017 · Viewed 7.2k times · Source

enter image description here

My designer send me sketch file which says 'Line height: 22' for label. How can i achieve this in xcode interface builder. Is there any way to define this line height using code or UI builder.

Answer

Tancrede Chazallet picture Tancrede Chazallet · Oct 9, 2019

@bbjay did put me on the right track.

If you want to obtain the exact result of Sketch, the formula is:

paragraphStyle .lineSpacing = sketchLineHeight - font.lineHeight

Provided that the font was given sketchFontSize