react-native-navigation的迁移库

RNNNavigationController.m 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. - (BOOL)isAnimated {
  14. UIViewController<RNNRootViewProtocol>* rootVC = (UIViewController<RNNRootViewProtocol>*) self.topViewController;
  15. return rootVC.isAnimated;
  16. }
  17. - (void)mergeOptions:(NSDictionary *)options {
  18. [((UIViewController<RNNRootViewProtocol>*)self.topViewController) mergeOptions:options];
  19. }
  20. - (NSString *)componentId {
  21. return ((UIViewController<RNNRootViewProtocol>*)self.topViewController).componentId;
  22. }
  23. - (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
  24. return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.showModal isDismiss:NO];
  25. }
  26. - (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
  27. return [[RNNModalAnimation alloc] initWithScreenTransition:self.options.animations.dismissModal isDismiss:YES];
  28. }
  29. - (RNNNavigationOptions *)options {
  30. return ((UIViewController<RNNRootViewProtocol>*)self.topViewController).options;
  31. }
  32. @end