CHAPTER 3

image

Stack Views and the Focus Engine

In iOS 9 Apple introduced Stack Views, and these are also available in tvOS. The UIStackView class provides an interface for laying out collections of views in either a column or a row. A Stack View lets you utilize Auto Layout, creating user interfaces that can dynamically adapt to any changes in the available space within your views. In iOS 9 Stack Views automatically adjust for autorotation and screen size.

In this chapter we will expand our WeatherStation app to use Stack Views and also explore how the tvOS Focus Engine works.

Auto Layout and Stack Views

Stack View uses Auto Layout to position and ...

Get Developing for Apple TV using tvOS and Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.