title: Accelerometer isn't registering? - Swift
body: <p>I am trying create navigation through the user shaking the iPhone to the side. However nothing seems to be working.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      let manager = CMMotionManager()
      if manager.deviceMotionAvailable {
          manager.deviceMotionUpdateInterval = 0.02
          manager.startDeviceMotionUpdatesToQueue(NSOperationQueue.mainQueue()) {
              [weak self] (data: CMDeviceMotion?, error: NSError?) in
  
              if data?.userAcceleration.x &lt; -2.5 {
                  self!.firstView.hidden = true
              }
          }
  
          }
  </code></pre>
  
  <p>I have imported Core Motion and Core Location and can't figure out whats wrong with it.</p>