react-native-navigation的迁移库

RNNNavigationController.m 1.4KB

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