代碼塊的故事板viewcontrollers動畫和它的工作,但不是我想要的.. iwant從左到右的動畫布做它的「左下角」到右上角。爲什麼不從左到右?objective-c CATransition問題
第二我如何停止動畫?
UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
UIViewController *destinationController = (UIViewController*)[self destinationViewController];
CATransition* transition = [CATransition animation];
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromRight;
[destinationController.view.layer addAnimation:transition forKey:kCATransition];
[sourceViewController presentViewController:destinationController animated:YES completion:nil];
'[sourceViewController presentViewController:destinationController animated:NO completion:nil];'設置'NO'爲Apple默認模態動畫 –