Open in app

Sign in

Write

Sign in

Stuart Moore
Stuart Moore

99 Followers

Home

About

Jun 21, 2021

Create Lists with AttributedString in iOS 15

Attributed strings are very powerful for laying out text; they’re more than just a way to convert HTML into bold ranges. When I worked at The Washington Post, I wrote an entire article layout engine utilizing a single NSAttributedString (with heavy use of text attachments). iOS 15 brings attributed strings…

IOS App Development

4 min read

Create Lists with AttributedString in iOS 15
Create Lists with AttributedString in iOS 15
IOS App Development

4 min read


Jul 30, 2015

Ligatures

1 min read

Ligatures
Ligatures

1 min read


Jul 16, 2015

UIFont Explained Visually

I feel like UIFont’s read-only properties go forgotten easily. When you create a new font object, five measurement properties will be evaluated based on the set point-size. Note that most of these will be floats and should be rounded up or down before using in any layout functions. Unless you’re drawing directly with the text, you’ll probably only ever need to use lineHeight (it’s the property multiplied by lineHeightMultiple in NSParagraphStyle). pointSize is almost useless; it tells you nothing about the actual pixels measurements.

Uifont

1 min read

UIFont Explained Visually
UIFont Explained Visually
Uifont

1 min read


Jun 26, 2015

NSParagraphStyle Explained Visually

I used to find myself randomly guessing a lot of magic numbers when it came to laying out paragraphs. The biggest issue I had was text clipping with small `lineHeightMultiples` — I figured that out in my last post. `NSParagraphStyle` is much better documented in the header file then its actual documentation (⌘-click an attribute to view). In lieu of that, I made a quick cheatsheet for everybody to understand what’s possible.

Swift

1 min read

NSParagraphStyle Explained Visually
NSParagraphStyle Explained Visually
Swift

1 min read


Jun 21, 2015

Fix Clipping UIFont lineHeightMultiple

Setting paragraph attributes on an `NSAttributedString` can be frustrating. Without a diagram, knowing what and how to set metrics isn’t super intuitive. You’ll end up fussing with all of them until it looks about right. The most frustrating is leading (pronounced /ˈlɛdɪŋ/ as in the metal used in printing presses)…

Lineheightmultiple

2 min read

Fix Clipping UIFont lineHeightMultiple
Fix Clipping UIFont lineHeightMultiple
Lineheightmultiple

2 min read

Stuart Moore

Stuart Moore

99 Followers

iOS at Capital One, Formerly at Washington Post & iA. America’s Sweetheart™

Following
  • Noah Martin

    Noah Martin

  • Christopher Ballard

    Christopher Ballard

  • Eric Horacek

    Eric Horacek

  • Khoi Vinh

    Khoi Vinh

  • Art of Tea

    Art of Tea

See all (41)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams