Magnetometer iOS code (Swift)

edited October 2016 in iOS
I'm unable to get the code for Magnetometer. Here's my code.


 device.gyro?.dataReadyEvent.startNotificationsWithHandlerAsync { (obj, error) in

            ...

        }

        

 device.magnetometer?.dataReadyEvent.startNotificationsWithHandlerAsync { (obj, error) in

            ...

        } 

     

Using this code, I'm able to get the data for Gyro, but not for Magnetometer. I'm getting the following error "value of type MBLMagnetometer has no member 'dataReadyEvent'".


How to get the data for magnetometer?

Comments

  • You have already made a thread about this.  Please continue the discussion in that thread instead of creating multiple threads about the same topic.
This discussion has been closed.