O'Reilly logo

Developing for Apple TV using tvOS and Swift by Brad Lees, Stefan Kaczmarek, Gary Bennett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required