次のようなコードが少しあります。
//up till now someButton's alpha was 1
someButton.alpha = 0;
[UIView animateWithDuration:.25
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 1;
}
completion:^ (BOOL finished){}];
問題は、アニメーションが始まる前に someButton のアルファが 0 に設定されていないことです。つまり、視覚的に何も起こりません。ここで、アニメーション ブロック全体をコメント アウトすると、実際に someButton のアルファが 0 に設定されます。また、これを行うと:
[UIView animateWithDuration:0
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 0;
} completion:^ (BOOL finished){
[UIView animateWithDuration:.25
delay:0.0
options:kMaskEaseOut
animations:^ {
someButton.alpha = 1;
}
completion:^ (BOOL finished){}];
}];
それはうまくいきます(長さ0のアニメーションの後にアニメーションを開始します)。これはちょっとばかげています。