No Description

AppDelegate.m 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import "AppDelegate.h"
  10. #import "RCTBundleURLProvider.h"
  11. #import "RCTRootView.h"
  12. // IMPORTANT: if you're getting an Xcode error that RCCManager.h isn't found, you've probably ran "npm install"
  13. // with npm ver 2. You'll need to "npm install" with npm 3 (see https://github.com/wix/react-native-navigation/issues/1)
  14. #import "RCTRootView.h"
  15. @implementation AppDelegate
  16. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  17. {
  18. NSURL *jsCodeLocation;
  19. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
  20. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  21. moduleName:@"example"
  22. initialProperties:nil
  23. launchOptions:launchOptions];
  24. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  25. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  26. UIViewController *rootViewController = [UIViewController new];
  27. rootViewController.view = rootView;
  28. self.window.rootViewController = rootViewController;
  29. [self.window makeKeyAndVisible];
  30. return YES;
  31. }
  32. @end