react-native-navigation的迁移库

AppDelegate.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #import "AppDelegate.h"
  2. // **********************************************
  3. // *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
  4. // **********************************************
  5. #import <React/RCTBundleURLProvider.h>
  6. #import <ReactNativeNavigation/ReactNativeNavigation.h>
  7. // IMPORTANT: if you're getting an Xcode error that RCCManager.h isn't found, you've probably ran "npm install"
  8. // with npm ver 2. You'll need to "npm install" with npm 3 (see https://github.com/wix/react-native-navigation/issues/1)
  9. #import <React/RCTRootView.h>
  10. @implementation AppDelegate
  11. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  12. {
  13. // **********************************************
  14. // *** DON'T MISS: THIS IS HOW WE BOOTSTRAP *****
  15. // **********************************************
  16. NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
  17. [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
  18. /*
  19. // original RN bootstrap - remove this part
  20. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  21. moduleName:@"com.example.WelcomeScreen"
  22. initialProperties:nil
  23. launchOptions:launchOptions];
  24. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  25. UIViewController *rootViewController = [UIViewController new];
  26. rootViewController.view = rootView;
  27. self.window.rootViewController = rootViewController;
  28. [self.window makeKeyAndVisible];
  29. */
  30. return YES;
  31. }
  32. @end