I am a pilot and ios developer. I would like to know if it is possible to create two methods that can send notifications when the altitude increases and another when the altitude decreases (takeoff and landing). I have already created a code that can retrieve the altitude.
- (CMAltimeter *)altimeter
{
if (!_altimeter) {
_altimeter = [[CMAltimeter alloc] init];
}
return _altimeter;
}
if you want, I can share the project with Dropbox to show you my code.
Your code only creates a
CMAltimeterinstance.To get altitude data, use
startRelativeAltitudeUpdatesToQueueafter checking if your device actually supports altimeter measurements, and send the notifications when you've detected a takeoff or landing in the callback: