Book Image

Learning iOS UI Development

Book Image

Learning iOS UI Development

Overview of this book

Through this comprehensive one-stop guide, you’ll get to grips with the entire UIKit framework and in a flash, you’ll be creating modern user interfaces for your iOS devices using Swift. Starting with an overview of the iOS drawing system and the available tools, you will then learn how to use these technologies to create adaptable layouts and custom elements for your applications. Next, you’ll be introduced to other topics such as animation and code-drawing with Core Graphics, which will give you all the knowledge you need to create astonishing user interfaces. By the end of this book, you will have a solid foundation in iOS user interface development and will have gained valuable insights on the process of building firm and complex UIs.
Table of Contents (16 chapters)
Learning iOS UI Development
About the Author
About the Reviewers

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...