react-native-navigation的迁移库

RNNNavigationController.m 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. @end