Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
React Native - use launch image as app background on iOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
UIViewController *rootViewController = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] firstObject];
rootView.backgroundColor = [UIColor clearColor];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[rootViewController.view addSubview:rootView];
rootView.frame = rootViewController.view.frame;
return YES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment