2つのボタンにウォブル機能を追加しました。startWobble
およびstopWobble
メソッドは適切に機能します。
- (void)startWobble {
_hint1.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-10));
_hint2.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-10));
[UIView animateWithDuration:0.001
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^ {
_hint1.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(10));
_hint2.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(10));
}
completion:NULL
];
}
- (void)stopWobble {
[UIView animateWithDuration:0.25
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveLinear)
animations:^ {
_hint1.transform = CGAffineTransformIdentity;
_hint2.transform = CGAffineTransformIdentity;
}
completion:NULL
];
}
ただし、シミュレーターでアプリをテストしたところ、ボタンがぐらつき始めたときに、近くにある他のボタンを押してしまいました。問題がわかりません。私はこれらの方法を使用してきましたが、これまでこのような問題に直面したことはありません。
助言がありますか?