Hey again guys this is Caleb with slopes dot com and in this video we're going to look at a few pages
from Apple's documentation for swift that explains what core motion is.
And we're also going to dive into the sea motion manager subclass where we'll be able to see all the
things that we get access to and it's not just the accelerometer.
That's the coolest part.
What you learn in this course can be applied to actually quite a few other instruments on your iPhone
that exist.
So go ahead and pull open a Safari window and you can either Google you know Apple documentation core
motion or just go to developer dot apple dot com slash documentation's slash core emotion.
It's up to you but this is where we're going to start.
And as you can see core motion helps to process accelerometer gyroscope pedometer and environment related
events.
Now believe it or not it actually gives you the ability to use the Magg magnetometer as well.
And I've seen some really cool uses for that like the Google cardboard VR headset for instance uses
the magnet magnetometer I always want to say magnetometer but the magnetometer to sense disturbances
in the magnetic field around the iPhone that's like you know how it uses the compass.
So when your phone is in the Google cardboard VR headset there's actually a magnet on the side and when
you pull that magnet down what happens is the magnet rushes by the magnetometer in the iPhone.
It senses a disturbance and it uses that magnet input as a trigger system so you can like you know shoot
guns in games in VR It's really really cool.
So there's tons of uses for the magnetometer the pedometer gyroscopes accelerometer.
I'm sure you can think of many uses for this but we're going to go ahead and look now at the CME motion
manager subclass.
All right.
And it is the object for starting and managing motion services so that's what we need to know because
that's where it begins.
So as you can see well they updated us here they added data for the magnetometer in Iowa S5 because
that's when an iPhone was first released with a magnetometer I believe it was the iPhone 3G S that had
the compass.
But anyway.
So you use a CM motion manager object to access accelerometer data rotation rate data magnetometer rate
data and other device motion data.
These types of data originate with the devices accelerometers it's magnetometer and gyroscope.
Typo there should be a space anyway.
So as you can see there's lots of information here.
We can get access to the accelerometer the devices gyroscope magnetometer and the device motion as well.
And there's all kinds of data we can get.
And guys I kid you not.
It is so easy to actually pull out this data and do stuff with it.
It's very cool how Apple has set it up for us to use.
So now that we've sort of seen the documentation and now that we understand the full scope of what is
possible we're going to go ahead and dive into receiving accelerometer updates with S.M. motion managers
so we're going to head over to the next video and we're going to start writing out that code right now.
So let's head over there and let's get started.