react-native-navigation的迁移库

RNNControllerFactory.m 597B

12345678910111213141516171819202122
  1. #import "RNNControllerFactory.h"
  2. #import "RNN.h"
  3. #import "RCTRootView.h"
  4. @implementation RNNControllerFactory
  5. +(UIViewController *)createRootViewController:(NSDictionary *)layout
  6. {
  7. NSString* containerName = layout[@"container"][@"name"];
  8. NSString* containerId = layout[@"container"][@"id"];
  9. RCTRootView *reactView = [[RCTRootView alloc] initWithBridge:RNN.instance.bridge moduleName:containerName initialProperties:@{@"containerId": containerId}];
  10. UIViewController* controller = [UIViewController new];
  11. controller.view = reactView;
  12. return controller;
  13. }
  14. @end