Interface-Object Layout

By far the most striking difference between WatchKit and UIKit user interface development is their different approaches to layout. On iOS you have free control over the placement of views. You can overlap them, rotate them, and place them anywhere onscreen. WatchKit, as you may have noticed, places everything for you. Try it out: go to your storyboard, make a new interface controller, and drag in a few buttons or labels. You’ll notice that they appear in a line, one below the next; the system places them on the screen in the order they appear in the Document Outline. If you add tons of interface objects, you’ll notice that interface controllers automatically scroll their contents when necessary; this is accomplished by ...

Get Developing for Apple Watch 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.