いくつかのグラフィカル要素を消したい、背景画像を移動すると、新しいものが表示されます。問題は、背景の動きのアニメーションが完了する前に新しい背景の動きが表示される場合です。関連する質問で良い答えが見られなかったので、助けていただければ幸いです。擬似コード:
-(void)method1 {
[UIView animateWithDuration:0.6
delay:0.0 options:UIViewAnimationOptionCurveEaseIn
animations:^{
self.setThisOne.hidden = YES;
self.setThisAnother.hidden = YES;
}completion:^(BOOL finished) {
[UIView animateWithDuration:0.6
delay:0.3
options: UIViewAnimationOptionCurveEaseIn
animations:^{ self.background.frame = myFrame; //Move background image
} completion:^(BOOL finished){
if (finished) {
[self method2];
}
}
];
}];
}
-(void)method2 {
[UIView animateWithDuration:0.2
delay:0.3
options: UIViewAnimationOptionBeginFromCurrentState
animations:^{
self.aButtonsAppear.hidden = NO;
self.moreElementsApeear.hidden = NO
} completion:nil];
}