Created
May 12, 2015 22:35
-
-
Save kwbock/fad6a7577e7966d789bb 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 "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 |
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
//... | |
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