From the course: Advanced iOS App Development: Core Motion

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Push and pull device motion

Push and pull device motion - iOS Tutorial

From the course: Advanced iOS App Development: Core Motion

Start my 1-month free trial

Push and pull device motion

- [Instructor] Even when the sensors exist, there's a problem with the sensors. Raw sensors do not distinguish between Earth's gravity compared to user accelerations. You can use the raw sensors if you wish, but for most cases, you'll want to use the CMDeviceMotion class to minimize this and other forms of noise. You can push or pull device motion. Let's start device motion up by making another function. We'll call it my device motion. Func. My device motion. I'm going to add a property to the class of interval. And we'll do it for half a second. And then back down in my device motion, I'll add the following, motion manager, and then I'm going to start to do this typing here, T A R T D E V, and you'll see the four choices that are going to pop up for device motion updates. Two are for pushing, and two are for pulling. In each of a method it sets the reference frame, which I'll talk about later. Let's look at pushing device motion first. Select the one that says start device motion…

Contents