Challenge: Changing Colors

Change the colors of the stripes based on the orientation of the device. There are three color channels (Red, Green, Blue) and three axes of movement (X, Y, Z). Assign a color to each axis. When the G force on an axis is closer to -1, set its color channel to 0 and when it is closer to 1 set its color channel to 1. Use the documentation!

Get iOS Programming: The Big Nerd Ranch Guide, Second 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.