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

User interface's traits


A trait consists of a set of properties that determines how the user interface or a portion of it should change as its environment or, more broadly, the available space for its contents and changes.

These properties include size classes for both horizontal and vertical dimensions as well as display scale, user interface idiom, and forceTouchCapability, and they define a trait collection.

Trait collection and trait environment

Designing adaptive user interfaces essentially means writing layouts that adapt according to changes in trait collections.

The UITraitCollection class is the data type that defines a trait collection and it is the entry point for the traits we described earlier. The following table illustrates the properties that are part of a trait collection:

Trait

Description

  • verticalSizeClass

  • (UIUserInterfaceSizeClass)

This is the vertical size class for the trait collection; the possible values for this property are .Regular, .Compact, or .Unspecified...

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