2015-08-04 12:50:22 +01:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-08-04 12:50:22 +01:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-08-04 12:50:22 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import "AppDelegate.h"
|
|
|
|
|
2016-11-23 07:47:52 -08:00
|
|
|
#import <React/RCTBundleURLProvider.h>
|
|
|
|
#import <React/RCTRootView.h>
|
2015-08-04 12:50:22 +01:00
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
|
|
{
|
|
|
|
NSURL *jsCodeLocation;
|
|
|
|
|
2018-12-06 19:27:33 -08:00
|
|
|
#ifdef DEBUG
|
|
|
|
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
|
|
|
#else
|
|
|
|
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
2015-08-04 12:50:22 +01:00
|
|
|
|
|
|
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
2016-11-18 18:25:02 -08:00
|
|
|
moduleName:@"HelloWorld"
|
2015-08-25 19:25:17 +01:00
|
|
|
initialProperties:nil
|
2015-08-04 12:50:22 +01:00
|
|
|
launchOptions:launchOptions];
|
2018-09-05 13:04:31 -07:00
|
|
|
rootView.backgroundColor = [UIColor blackColor];
|
2015-08-04 12:50:22 +01:00
|
|
|
|
|
|
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
2015-11-02 07:58:47 -08:00
|
|
|
UIViewController *rootViewController = [UIViewController new];
|
2015-08-04 12:50:22 +01:00
|
|
|
rootViewController.view = rootView;
|
|
|
|
self.window.rootViewController = rootViewController;
|
|
|
|
[self.window makeKeyAndVisible];
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|