react-native-navigation的迁移库

RNNDefaultOptionsHelper.m 751B

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) setDefaultOptions:defaultOptions];
  6. for (UIViewController<RNNLayoutProtocol>* childViewController in rootViewController.childViewControllers) {
  7. if ([childViewController conformsToProtocol:@protocol(RNNLayoutProtocol)]) {
  8. [childViewController setDefaultOptions:defaultOptions];
  9. }
  10. [self recrusivelySetDefaultOptions:defaultOptions onRootViewController:childViewController];
  11. }
  12. }
  13. @end