설명 없음

AppDelegate.m 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. #import "AppDelegate.h"
  2. #import <React/RCTBridge.h>
  3. #import <React/RCTBundleURLProvider.h>
  4. #import <React/RCTRootView.h>
  5. @implementation AppDelegate
  6. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  7. {
  8. RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  9. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
  10. moduleName:@"example"
  11. initialProperties:nil];
  12. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  13. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  14. UIViewController *rootViewController = [UIViewController new];
  15. rootViewController.view = rootView;
  16. self.window.rootViewController = rootViewController;
  17. [self.window makeKeyAndVisible];
  18. return YES;
  19. }
  20. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  21. {
  22. #if DEBUG
  23. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:nil];
  24. #else
  25. return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  26. #endif
  27. }
  28. @end