Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  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.  
  8. #import "AppDelegate.h"
  9.  
  10. #import <React/RCTBridge.h>
  11. #import <React/RCTBundleURLProvider.h>
  12. #import <React/RCTRootView.h>
  13.  
  14. @implementation AppDelegate
  15.  
  16. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  17. {
  18. RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  19. RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
  20. moduleName:@"testProj"
  21. initialProperties:nil];
  22.  
  23. rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  24.  
  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.  
  33. - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  34. {
  35. #if DEBUG
  36. return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  37. #else
  38. return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  39. #endif
  40. }
  41.  
  42. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement