iOS & Swift

Auto Layout by Tutorials

The best book to teach you Auto Layout, Apple’s elegant solution to making your user interfaces flexible and adaptable. By Libranner Santos & Jayven Nhan.

Read for Free with the Personal Plan* * Includes this and all other books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
Leave a rating/review
Download materials
Buy paperback—Amazon Comments
Save for later
Share

Who is this for?

This book is for iOS developers of all skill levels, from those just getting started building user interfaces to the experienced hands who want to get more from Auto Layout.

Covered concepts

  • Interface Builder
  • Stack Views and Scroll Views
  • Self-Sizing Views
  • Animating Constraints
  • Adaptive Layout
  • Resolving Common Issues

This book will be your guide as you explore and master the many capabilities of Auto Layout.

This book is for iOS developers of all skill levels, from those just getting started building user interfaces to the experienced hands who want to get more from Auto Layout.

Take a deep...

more

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Section I: Beginning Auto Layout

Start your journey into Auto Layout with the foundations you need.

1
Toggle description
Get an overview of Auto Layout and how to start “thinking in Auto Layout”. Learn what constraints are and the formula that defines them. Meet other key concepts such as intrinsic content size and priorities.
Learn to use Xcode’s visual tool, Interface Builder, to construct a user interface complete with all Auto Layout constraints. See how to preview your interface on multiple device sizes and orientations. Then, learn to create .xib files to describe a smaller — and potentially reusable — subset of a UI.
Toggle description
Learn about UIStackView, an intelligent view container that makes many layout decisions for you. Build a complex layout using nested stack views. See how using stack views can eliminate the need for you to manually construct Auto Layout constraints.

Section II: Intermediate Auto Layout

Build on what you learned in Section I to begin using Auto Layout in more complex ways.

Toggle description
Learn how to build your user interface without using Interface Builder. Explore the Visual Format Language (VFL), which you can use to describe a set of constraints. Learn to refactor UIs built with Interface Builder into code.
Toggle description
Use scroll views to create user interfaces that go beyond the size of a physical screen. Learn about the special challenges they present when using Auto Layout and discover how to configure them.
Toggle description
Learn how to configure views that change size to account for dynamic content. See how to use Auto Layout to configure dynamically-sized cells in table views and collection views.
Toggle description
Explore using Layout Guides to create space in your layout without using empty views. Learn about the system-provided guides and how to create your own custom guides.
Discover what happens when the Auto Layout engine must choose between conflicting constraints. Learn how to use priorities to communicate how the system should resolve ambiguities to create the layout you want.
Learn to animate constraints to create unique and engaging user experiences in your apps. See how animation can provide feedback, focus user attention and improve navigation.
Toggle description
See Auto Layout’s real power come to life as you learn how to build adaptive user interfaces that adjust to screen size and orientation. Learn about traits such as layout direction, dynamic type size and size classes. Discover how trait collections allow you to build an adaptive layout without writing device-specific code.
Toggle description
Learn to make your app more accessible by supporting Dynamic Type. Understand how Auto Layout and Dynamic Type interact so you can manage layout changes in your app based on user type size preferences.
Learn how Auto Layout can assist you in internationalizing your app. See how to test if your app is ready for localization. Discover the things you must consider when creating your constraints to allow your app to handle other languages seamlessly.
Toggle description
Learn how to investigate when Auto Layout doesn’t give you the desired result. See how to read Auto Layout’s log messages and how to use other Xcode tools, such as symbolic breakpoints and the view debugger, to resolve Auto Layout conflicts.

Section III: Advanced Auto Layout

Deepen your knowledge of Auto Layout by exploring these more advanced topics.

Toggle description
Pull back the curtain and see the inner workings of Auto Layout. Explore the math behind the magic and discover the “why” behind the behavior of the Auto Layout engine.
Learn to fine-tune your app’s Auto Layout performance. Learn about best practices and about common mistakes that cost you performance.
Learn to use Xcode playgrounds to prototype your user interfaces. See how this technique can streamline your development process and make you more efficient.
Learn how to support external displays in your app. Learn to build a layout for external display, how to handle display connect and disconnect events, and how to accommodate different external display resolutions.
Toggle description
Learn how to support external displays in your app. Learn to build a layout for external display, how to handle display connect and disconnect events, and how to accommodate different external display resolutions.