•   over 4 years ago

Error: Extra argument 'withHandler' in call

I'm trying to retrieve the relative altitude of the user using CoreMotion API:

import CoreMotion;

//Try the following code in viewDidLoad()

CMAltimeter.startRelativeAltitudeUpdatesToQueue(NSOperationQueue.mainQueue(), withHandler: { altitudeData, error in
if(error != nil)
{
NSLog(toString(altitudeData.relativeAltitude));
}
})

I see an error Extra argument 'withHandler' in call! Now this is surprising coz it worked well initially and then started throwing a compile time error. I am trying to figure what I have changed but to no success.

Look forward to your response. Thanks.

  • 0 comments

Comments are closed.