react-native-navigation的迁移库

RNNBridgeModule.m 676B

12345678910111213141516171819202122232425262728293031
  1. #import "RNNBridgeModule.h"
  2. #import "RNNStore.h"
  3. #import "RNNControllerFactory.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. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  13. RCTBridge* bridge = RNNStore.sharedInstance.bridge;
  14. RNNStore.appDelegate.window.rootViewController = [RNNControllerFactory createRootViewController:layout];
  15. [RNNStore.appDelegate.window makeKeyAndVisible];
  16. });
  17. }
  18. @end