react-native-navigation的迁移库

RNNBridgeModule.m 681B

1234567891011121314151617181920212223242526
  1. #import "RNNBridgeModule.h"
  2. #import "RNNStore.h"
  3. #import "RCTRootView.h"
  4. @implementation RNNBridgeModule
  5. RCT_EXPORT_MODULE(NativeNavigation);
  6. - (dispatch_queue_t)methodQueue
  7. {
  8. return dispatch_get_main_queue();
  9. }
  10. RCT_EXPORT_METHOD(startApp:(NSDictionary*)layout)
  11. {
  12. RCTRootView *reactView = [[RCTRootView alloc] initWithBridge:RNNStore.sharedInstance.bridge moduleName:@"com.example.WelcomeScreen" initialProperties:@[@{@"containerId": @"123"}]];
  13. UIViewController* controller = [UIViewController new];
  14. controller.view = reactView;
  15. RNNStore.appDelegate.window.rootViewController = controller;
  16. [RNNStore.appDelegate.window makeKeyAndVisible];
  17. }
  18. @end