react-native-navigation的迁移库

RNNNavigationController.m 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #import "RNNNavigationController.h"
  2. #import "RNNModalAnimation.h"
  3. @implementation RNNNavigationController
  4. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  5. return self.viewControllers.lastObject.supportedInterfaceOrientations;
  6. }
  7. - (BOOL)isCustomTransitioned {
  8. return NO;
  9. }
  10. - (BOOL)isCustomViewController {
  11. return [((UIViewController<RNNRootViewProtocol>*)self.topViewController) isCustomViewController];
  12. }
  13. - (void)mergeOptions:(NSDictionary *)options {
  14. [((UIViewController<RNNRootViewProtocol>*)self.topViewController) mergeOptions:options];
  15. }
  16. - (NSString *)componentId {
  17. return ((UIViewController<RNNRootViewProtocol>*)self.topViewController).componentId;
  18. }
  19. - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
  20. return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.showModal isDismiss:NO];
  21. }
  22. - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
  23. return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.dismissModal isDismiss:YES];
  24. }
  25. - (RNNNavigationOptions *)options {
  26. return ((UIViewController<RNNRootViewProtocol>*)self.topViewController).options;
  27. }
  28. - (UIViewController *)childViewControllerForStatusBarStyle {
  29. return self.topViewController;
  30. }
  31. @end