Group Basics

You can think of every interface controller in your app as its own group. When you add interface objects to the interface controller, WatchKit’s layout system places them in order, top to bottom. The first cool feature of groups is that you can control the direction of the layout—while the interface controller in the storyboard defaults to arranging its objects top to bottom, a group can also arrange its objects left to right. You can also specify the size of the group relative to its container, whether that’s the interface controller itself or another group. And you can pick a background image or background color. Best of all, you can add a group to another group, allowing for nested groups. Nested groups allow for some extremely ...

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.