Chapter 4Organizing Your UI with Groups

The UI system in WatchKit is entirely linear. As you’ve seen thus far, when you add interface objects to an interface controller, they stack from top to bottom. Instead of using Auto Layout to position user interface objects with constraints, or the old “springs and struts” style of autoresizing masks that came before it, WatchKit handles positioning interface objects on your behalf. You probably noticed this behavior when you were adding interface objects to your storyboard.

This system of automatically positioning elements in a sequence is much more like the new UIStackView class in iOS than the other, older iOS layout paradigms. Introduced in iOS 9, UIStackView class is a container for other ...

Get Developing for Apple Watch, 2nd Edition 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.