react-native-navigation的迁移库

RNNDefaultOptionsHelper.m 771B

12345678910111213141516171819
  1. #import "RNNDefaultOptionsHelper.h"
  2. @implementation RNNDefaultOptionsHelper
  3. + (void)recrusivelySetDefaultOptions:(RNNNavigationOptions *)defaultOptions onRootViewController:(UIViewController *)rootViewController {
  4. if ([rootViewController conformsToProtocol:@protocol(RNNLayoutProtocol)])
  5. [((UIViewController<RNNLayoutProtocol> *)rootViewController).presenter setDefaultOptions:defaultOptions];
  6. for (UIViewController<RNNLayoutProtocol>* childViewController in rootViewController.childViewControllers) {
  7. if ([childViewController conformsToProtocol:@protocol(RNNLayoutProtocol)]) {
  8. [childViewController.presenter setDefaultOptions:defaultOptions];
  9. }
  10. [self recrusivelySetDefaultOptions:defaultOptions onRootViewController:childViewController];
  11. }
  12. }
  13. @end