The Library Bookmarks · Notes · Snippets

← Back to the front page Filed

Apply style modifiers to text

Read it at developer.apple.com ↗ swift

Swift rolls out sizes out of the box (caption/body/headline/title1-3, etc.), and then you can use .center , .weight(), and .italic for the other styles:

Text((textVariable)).font(Font.caption.weight(.light)).multilineTextAlignment(.center).italic()

■