react-native-navigation的迁移库

RNNNavigationController.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #import "RNNNavigationController.h"
  2. #import "RNNModalAnimation.h"
  3. @implementation RNNNavigationController
  4. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  5. return self.viewControllers.lastObject.supportedInterfaceOrientations;
  6. }
  7. - (UINavigationController *)navigationController {
  8. return self;
  9. }
  10. - (UIStatusBarStyle)preferredStatusBarStyle {
  11. return self.getLeafViewController.preferredStatusBarStyle;
  12. }
  13. - (UIModalPresentationStyle)modalPresentationStyle {
  14. return self.getLeafViewController.modalPresentationStyle;
  15. }
  16. - (UIViewController *)popViewControllerAnimated:(BOOL)animated {
  17. return [super popViewControllerAnimated:animated];
  18. }
  19. - (NSString *)componentId {
  20. return _componentId ? _componentId : self.getLeafViewController.componentId;
  21. }
  22. - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
  23. return [[RNNModalAnimation alloc] initWithScreenTransition:self.getLeafViewController.options.animations.showModal isDismiss:NO];
  24. }
  25. - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
  26. return [[RNNModalAnimation alloc] initWithScreenTransition:self.getLeafViewController.options.animations.dismissModal isDismiss:YES];
  27. }
  28. - (UIViewController *)getLeafViewController {
  29. return ((UIViewController<RNNRootViewProtocol>*)self.topViewController);
  30. }
  31. - (UIViewController *)childViewControllerForStatusBarStyle {
  32. return self.topViewController;
  33. }
  34. @end