Açıklama Yok

AppDelegate.m 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import "AppDelegate.h"
  8. #import <React/RCTBundleURLProvider.h>
  9. #import <React/RCTRootView.h>
  10. @implementation AppDelegate
  11. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  12. {
  13. NSURL *jsCodeLocation;
  14. #ifdef DEBUG
  15. jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  16. #else
  17. jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  18. #endif
  19. RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  20. moduleName:@"simpleDemo"
  21. initialProperties:nil
  22. launchOptions:launchOptions];
  23. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  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. return YES;
  30. }
  31. @end