react-native-navigation的迁移库

ModalTransitionDelegate.m 1.2KB

12345678910111213141516171819202122232425262728
  1. #import "ModalTransitionDelegate.h"
  2. @implementation ModalTransitionDelegate
  3. - (instancetype)initWithContentTransition:(TransitionOptions *)contentTransitionOptions uiManager:(RCTUIManager *)uiManager {
  4. self = [super initWithUIManager:uiManager];
  5. _contentTransitionOptions = contentTransitionOptions;
  6. return self;
  7. }
  8. - (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView {
  9. ContentTransitionCreator* contentTransition = [ContentTransitionCreator createTransition:_contentTransitionOptions view:toVC.view fromVC:fromVC toVC:toVC containerView:containerView];
  10. return @[contentTransition];
  11. }
  12. - (void)prepareTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext {
  13. UIViewController* toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
  14. toVC.view.alpha = 0;
  15. [transitionContext.containerView addSubview:toVC.view];
  16. }
  17. - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
  18. return self;
  19. }
  20. @end