Skip to main content
Logo Appt Light

Text spacing on iOS

Content should adapt to increased spacing between lines, words, letters, and paragraphs. This helps users with effectively reading text.

On iOS, you can use NSMutableParagraphStyle for paragraphs:

To adjust the spacing between letters you can use the NSKernAttributeName attribute.

let style = NSMutableParagraphStyle()
style.lineSpacing = 20
style.lineHeightMultiple = 1.5
style.paragraphSpacing = 20

let attributedString = NSAttributedString(string: "Appt", attributes: [
    .paragraphStyle:  style,
    .kern: 3.0
])
element.attributedText = attributedString

Feedback?

Let us know!