Swift 3.0 how to use startDeviceMotionUpdates (to: withHandler)?

Swift 3.0 was released with Xcode 8.0 and, apparently, a lot has changed. I am very unfamiliar with the new syntax in swift. Can anybody help me? I'm trying to figure out what is going on in

motionManager.startDeviceMotionUpdates(
        to: OperationQueue.current()!,
        withHandler: )

after "withHandler:"

I am trying to get my SceneKit program to use an accelerometer to determine the orientation of the SCNNode platform. I am also pretty new to fast (about 5 days in programming in Swift), so if there is something fundamental, I get confused, let me know.

+4
source share
1 answer

Reference

, CMDeviceMotionHandler.

 motionManager.startDeviceMotionUpdates(to: OperationQueue.current()!, withHandler:{
                deviceManager, error in
                //Do stuffs with deviceManager or with error

            })
+6

All Articles