私はViewControllerが言うことができViewControllerA
、ViewControllerが言うことができますViewControllerB
。
ViewControllerB
ViewControllerA
カスタムトランジションを使用してモーダルに表示されます。
ViewControllerA で:
-(void)buttonClicked...
{
ViewControllerB * controller = [[ViewControllerB alloc] init];
[controller setModalPresentationStyle:UIModalPresentationCustom];
controller.transitioningDelegate = self;
[self presentViewController:controller animated:YES completion:nil];
}
ViewControllerA で -
#pragma mark - UIViewControllerTransitioningDelegate
-
(id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
presentingController:(UIViewController *)presenting
sourceController:(UIViewController *)source
{
FadeInWithPopAnimator* fadeInAnimator = [[FadeInWithPopAnimator alloc] init];
return fadeInAnimator;
}
FadeInWithPopAnimator
transitionDuration および animationTransition メソッドを実装するカスタム Animator クラスを呼び出しました。
提示されたビューコントローラーでいくつかのビューをアニメーション化したい -ViewControllerB
遷移アニメーションが開始されてから 0.2 秒後。
私はオンラインでドキュメントを読みましたが、transitionCoordinator を使用する方法が適しているようです。しかし、どこにコードを置くべきですか?
ViewControllerA
1) ?で presentViewController を呼び出している間。
2)アニメータークラスで?
3) のビューで表示されViewControllerA
ますか?
いくつか試してみましたが、結果が得られず、例を見つけるのが困難です。