Back when the original iPad launched Apple showed off one of those “Jony Ive in an infinitely white room” videos, where Jony had this to say: “it’s true: when something exceeds your ability to understand how it works, it sort of becomes magical – and that’s exactly what the iPad is.”
When our apps run, they usually take up the full amount of screen space – they literally take over the iPad, as if the user were holding a device specifically crafted for our app and nothing else. If iOS forced us to display system elements around our app, or if iPads had lots of buttons scattered around the front of its display, that illusion would be broken.
Today you’re going to see just how important this is: we’ll use Core Motion to let the user tip their iPad to control the game. And because our code takes over the full iPad screen, the end result just feels amazing – one huge piece of glass that the player can bounce around as if it were an old wooden toy.
Today you have two topics to work through, and you’ll learn about reading the accelerometer using Core Motion and combining bitmasks using |
, while also getting more practice with SKAction
sequences, and more.
Need help? Tweet me @twostraws!
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.
Link copied to your pasteboard.