そのため、2つの画像を切り替えようとしましたが、継続時間は無視されているようです。Appleは魔法を存続させるために非常に迅速にアニメーションを実行する必要があることを理解していますが、反転を遅くする方法はありますか?
私の現在のオブジェクト階層は、ゲームボードにUIViewから継承する多くのカードが含まれていることです。カードには、UIImageやその他のデータをホストするUIViewである表と裏があります
[UIView animateWithDuration:15.0
animations:^(void) {
cardOne.center =CGPointMake(100, 100);
cardTwo.center =CGPointMake(100, 100);
//low level calls, to directly perform the image swap
[cardOne.face removeFromSuperview];
[cardOne addSubview:cardOne.back];
[cardOne sendSubviewToBack:cardOne.face];
//calling the transitionFromView to do the image swap
[UIView transitionFromView:cardOne.face
toView:cardOne.back
duration:10
options:UIViewAnimationTransitionFlipFromLeft
completion:^(BOOL finished){ }];
ご意見をいただきありがとうございます。入力したものをすべて組み合わせてみましたが、正しく機能しました。理由はまだわかりません。ご回答ありがとうございます。古いスタイルに戻してみましたが、うまくいきました。理由はまだわかりません。
動作していないコードはコメント化され、動作しているコードはコメントされません。再度、感謝します
/*
[UIView animateWithDuration:animationDuration
animations:^{
[self.face removeFromSuperview];
[self addSubview:self.back];
[self sendSubviewToBack:self.face];
}];
*/
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kDefaultFlipSpeed];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self
cache:YES];
[self.face removeFromSuperview];
[self addSubview:self.back];
[self sendSubviewToBack: self.face];
[UIView commitAnimations];