12345678910111213141516171819202122232425 |
- #import "ModalDismissTransitionDelegate.h"
-
- @implementation ModalDismissTransitionDelegate
-
- - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
- return self;
- }
-
- - (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView {
- ContentTransitionCreator* contentTransition = [ContentTransitionCreator createTransition:self.contentTransitionOptions view:fromVC.view fromVC:fromVC toVC:toVC containerView:containerView];
-
- return @[contentTransition];
- }
-
- - (void)prepareTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext {
- UIViewController* toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
- UIViewController* fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
-
- fromVC.view.alpha = 0;
- [transitionContext.containerView addSubview:toVC.view];
- [transitionContext.containerView addSubview:fromVC.view];
- }
-
- @end
|