title: Converting Swift 1.2 code to Swift 2
body: <p>I've tried for 15 minutes trying to figure out how to use this code from a book which was written before Swift 2, in an Xcode 7 app in Swift 2. Here's the code snippit:                            </p>
  
  <pre><code>    self.coreMotionManager.accelerometerUpdateInterval = 0.3
  self.coreMotionManager.startAccelerometerUpdatesToQueue(NSOperationQueue(), withHandler: {
  
      (data: CMAccelerometerData!, error: NSError!) in
  
          if let constVar = error { 
  
   println("There was an error")
           }
           else {
  
               self.xAxisAcceleration = CGFloat(data!.acceleration.x)
           } })
  </code></pre>
  
  <p>I get the error: "Cannot invoke 'startAccelerometerUpdatesToQueue' with an argument list of type '(NSOperationQueue, withHandler: (CMAccelerometerData!, NSError!) -> _)'</p>