react-native-navigation的迁移库

ModalDismissTransitionDelegate.m 1.1KB

12345678910111213141516171819202122232425
  1. #import "ModalDismissTransitionDelegate.h"
  2. @implementation ModalDismissTransitionDelegate
  3. - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
  4. return self;
  5. }
  6. - (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView {
  7. ContentTransitionCreator* contentTransition = [ContentTransitionCreator createTransition:self.contentTransitionOptions view:fromVC.view fromVC:fromVC toVC:toVC containerView:containerView];
  8. return @[contentTransition];
  9. }
  10. - (void)prepareTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext {
  11. UIViewController* toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
  12. UIViewController* fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
  13. fromVC.view.alpha = 0;
  14. [transitionContext.containerView addSubview:toVC.view];
  15. [transitionContext.containerView addSubview:fromVC.view];
  16. }
  17. @end