AppDelegate.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 <React/RCTBundleURLProvider.h>
  11. #import <React/RCTRootView.h>
  12. @implementation AppDelegate
  13. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  14. {
  15. NSURL *jsCodeLocation;
  16. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
  17. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  18. moduleName:@"todo"
  19. initialProperties:nil
  20. launchOptions:launchOptions];
  21. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  22. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  23. UIViewController *rootViewController = [UIViewController new];
  24. rootViewController.view = rootView;
  25. self.window.rootViewController = rootViewController;
  26. [self.window makeKeyAndVisible];
  27. return YES;
  28. }
  29. @end