5度ごとに回転するコンパスを作成していますが、問題は、ユーザーがデバイスを5度以上回転させると、同時に複数の応答が得られ、デバイスを回転させるメソッドが最後の前に数回呼び出されることです1つは終了するため、コンパスにスムーズに進むことはできません。最後のコンパスが終了した後にコンパスを回転させるにはどうすればよいですか?
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
if (newHeading.headingAccuracy > 0) {
/* Rotate the compass to the selected degree */
[UIView animateWithDuration:1.0f animations:^{
[self.compassImageView rotateByDegree:degree clockWise:YES];
}];
}
}