Skip to content

Instantly share code, notes, and snippets.

@kwbock
Created May 12, 2015 22:35
Show Gist options
  • Save kwbock/fad6a7577e7966d789bb to your computer and use it in GitHub Desktop.
Save kwbock/fad6a7577e7966d789bb to your computer and use it in GitHub Desktop.
#import "AppDelegate.h"
#import "RCTRootView.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//other code
RCTRootView *rootView;
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) }
rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"AppNameIpad"
launchOptions:launchOptions];
} else {
rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"AppNameIphone"
launchOptions:launchOptions];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
//...
var AppNameIphone = React.createClass({
//..
});
var AppNameIpad = React.createClass({
//..
});
AppRegistry.registerComponent('AppNameIphone', () => AppNameIpone);
AppRegistry.registerComponent('AppNameIpad', () => AppNameIpad);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment