Closed qadirsuh closed 3 years ago
I have done like below in my ViewController
`import UIKit import AVFoundation import CoreMotion class ViewController: UIViewController, MotionKitDelegate { override func viewDidLoad() { super.viewDidLoad() let motionKit = MotionKit() motionKit.delegate = self // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func retrieveAccelerometerValues (x: Double, y:Double, z:Double, absoluteValue: Double){ } func retrieveGyroscopeValues (x: Double, y:Double, z:Double, absoluteValue: Double){ } @objc func retrieveDeviceMotionObject (deviceMotion: CMDeviceMotion){ } func retrieveMagnetometerValues (x: Double, y:Double, z:Double, absoluteValue: Double){ print("x \(x), y \(y), z \(z), absoluteValue \(absoluteValue)") } func getAccelerationValFromDeviceMotion (x: Double, y:Double, z:Double){ } func getGravityAccelerationValFromDeviceMotion (x: Double, y:Double, z:Double){ } func getRotationRateFromDeviceMotion (x: Double, y:Double, z:Double){ print("x \(x), y \(y), z(z)") } func getMagneticFieldFromDeviceMotion (x: Double, y:Double, z:Double){ print("x \(x), y \(y), z(z)") } @objc func getAttitudeFromDeviceMotion (attitude: CMAttitude){ } }
` I just see the only Log is MotionKit has been initialised successfully
as you have done in the init() like below
` init(){ NSLog("MotionKit has been initialised successfully") } `
I have changed like this
` init(){ manager.showsDeviceMovementDisplay = true NSLog("MotionKit has been initialised successfully") }`
still no any functions are called. What I am missing?
I have done like below in my ViewController
` I just see the only Log is MotionKit has been initialised successfully
as you have done in the init() like below
I have changed like this
still no any functions are called. What I am missing?