Animation and Groups
As you saw earlier, WKInterfaceController’s animateWithDuration(duration:animations:) method allows you to update properties of your interface objects inside an animation. WKInterfaceGroup is no different, and you can animate all sorts of properties, just like other interface objects. One animation property belongs to groups alone, and that is the content inset. This inset allows you to push content back from the edge of the group, and it can be useful for moving an object around the screen with more control than simple horizontal or vertical alignment.
To illustrate group animations, let’s make a simple watchOS game. Turns out, we can make one to illustrate group animation in about 100 lines of Swift! Our simple “game” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access