I'm using Text Kit to layout some custom text in an app of mine, and I want to create nice-looking lists, with properly aligned enumerators. I need the text to look like so:
The pink line is not part of the desired effect, but to emphasise how the enumerators should aligned (ie. they need to be right-aligned, but the text on the left should still be left-aligned).
I have the list style implemented bar this requirement (the enumerators are at present left-aligned). I'm doing this by adding the enumerator as a string, with a tab character (\t
) after it, and adding a custom tab stop (NSTextTab
) at the desired position to the NSParagraphStyle
. Subsequent lines are indented by setting the headIndent
to the equivalent position as the NSTextTab
.
Any thoughts on how I can align the enumerators as I want?