Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning iOS UI Development

You're reading from   Learning iOS UI Development Implement complex iOS user interfaces with ease using Swift

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785288197
Length 196 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Exploring text styles


The first step in order to understand and take advantage of Dynamic Type is to learn what a text style is.

You are probably used to defining fonts by setting the font size and font family. This definition is really strict, in that you are setting fixed sizes via specific numeric values.

A text style is more likely to be intended as a semantic description that doesn't give any information about font size but describes the way the font is used within the text context. Now, you can choose between six different styles with quite self-explanatory names:

  • UIFontTextStyleTitle(1,2,3)

  • UIFontTextStyleHeadline

  • UIFontTextStyleSubheadline

  • UIFontTextStyleBody

  • UIFontTextStyleCallout

  • UIFontTextStyleFootnote

  • UIFontTextStyleCaption1

  • UIFontTextStyleCaption2

Each text style, depending on the user's preferences, is associated with specific traits and a font size that is not under our control.

The simplest way to create UI elements that use text styles is through Interface Builder. We...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime