-
-
Save ybonnetain/7b3e510050447ae52c0f8d6dd741d9d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <React/RCTBridgeDelegate.h> | |
#import <React/RCTBundleURLProvider.h> | |
#import <React/RCTRootView.h> | |
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate> | |
@end | |
@implementation AppDelegate | |
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge | |
{ | |
#if DEBUG | |
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; | |
#else | |
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; | |
#endif | |
} | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self | |
launchOptions:launchOptions]; | |
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge | |
moduleName:@"MyApp" | |
initialProperties:@{}]; | |
rootView.backgroundColor = [UIColor whiteColor]; | |
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
self.window.rootViewController = rootView; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment