I have a ViewController lets say ViewControllerA
and a ViewController lets say ViewControllerB
.
ViewControllerB
is modally presented from ViewControllerA
using a custom transition.
In ViewControllerA:
-(void)buttonClicked...
{
ViewControllerB * controller = [[ViewControllerB alloc] init];
[controller setModalPresentationStyle:UIModalPresentationCustom];
controller.transitioningDelegate = self;
[self presentViewController:controller animated:YES completion:nil];
}
In ViewControllerA -
#pragma mark - UIViewControllerTransitioningDelegate
-
(id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented
presentingController:(UIViewController *)presenting
sourceController:(UIViewController *)source
{
FadeInWithPopAnimator* fadeInAnimator = [[FadeInWithPopAnimator alloc] init];
return fadeInAnimator;
}
I have an custom Animator class called FadeInWithPopAnimator
which implements the transitionDuration and animationTransition methods.
I want to animate a couple of views on the presented viewcontroller - ViewControllerB
, 0.2 seconds after the transition animation starts.
I have read the docs online and it looks like using a transitionCoordinator is the way to go. But where should I put the code ?
1) While calling the presentViewController in ViewControllerA
?
2) In the Animator class ?
3) In viewWillAppear of ViewControllerA
?
I have tried a couple of things but it is not giving me results and examples are hard to find.