react-native-navigation的迁移库

AppDelegate.m 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #import "AppDelegate.h"
  2. // **********************************************
  3. // *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
  4. // **********************************************
  5. #import "RCCManager.h"
  6. // IMPORTANT: if you're getting an Xcode error that RCCManager.h isn't found, you've probably ran "npm install"
  7. // with npm ver 2. You'll need to "npm install" with npm 3 (see https://github.com/wix/react-native-navigation/issues/1)
  8. #import "RCTRootView.h"
  9. @implementation AppDelegate
  10. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  11. {
  12. NSURL *jsCodeLocation;
  13. jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
  14. // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  15. // **********************************************
  16. // *** DON'T MISS: THIS IS HOW WE BOOTSTRAP *****
  17. // **********************************************
  18. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  19. self.window.backgroundColor = [UIColor whiteColor];
  20. [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
  21. /*
  22. // original RN bootstrap - remove this part
  23. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  24. moduleName:@"example"
  25. initialProperties:nil
  26. launchOptions:launchOptions];
  27. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  28. UIViewController *rootViewController = [UIViewController new];
  29. rootViewController.view = rootView;
  30. self.window.rootViewController = rootViewController;
  31. [self.window makeKeyAndVisible];
  32. */
  33. return YES;
  34. }
  35. @end