mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-03 22:43:35 +08:00
- [ReactNative] Add root package.json name back | Tadeu Zagallo
- [react-packager] Make sure projectRoots is converted to an array | Amjad Masad
- [ReactNative] Init script that bootstraps new Xcode project | Alex Kotliarskyi
- [ReactNative] New SampleApp | Alex Kotliarskyi
- [ReactNative] Touchable invoke press on longPress when longPress handler missing | Eric Vicenti
- [ReactNative] Commit missing RCTWebSocketDebugger.xcodeproj | Alex Kotliarskyi
- [ReactNative] Add Custom Components folder | Christopher Chedeau
- [react-packager] Hash cache file name information to avoid long names | Amjad Masad
- [ReactNative] Put all iOS-related files in a subfolder | Alex Kotliarskyi
- [react-packager] Fix OOM | Amjad Masad
- [ReactNative] Bring Chrome debugger to OSS. Part 2 | Alex Kotliarskyi
- [ReactNative] Add search to UIExplorer | Tadeu Zagallo
- [ReactNative][RFC] Bring Chrome debugger to OSS. Part 1 | Alex Kotliarskyi
- [ReactNative] Return the appropriate status code from XHR | Tadeu Zagallo
- [ReactNative] Make JS stack traces in Xcode prettier | Alex Kotliarskyi
- [ReactNative] Remove duplicate package.json with the same name | Christopher Chedeau
- [ReactNative] Remove invariant from require('react-native') | Christopher Chedeau
- [ReactNative] Remove ListViewDataSource from require('react-native') | Christopher Chedeau
- [react-packager] Add assetRoots option | Amjad Masad
- Convert UIExplorer to ListView | Christopher Chedeau
- purge rni | Basil Hosmer
- [ReactNative] s/render*View/render/ in <WebView> | Christopher Chedeau
45 lines
1.5 KiB
Objective-C
45 lines
1.5 KiB
Objective-C
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#import "AppDelegate.h"
|
|
|
|
#import "RCTRootView.h"
|
|
|
|
@implementation AppDelegate
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
{
|
|
NSURL *jsCodeLocation;
|
|
RCTRootView *rootView = [[RCTRootView alloc] init];
|
|
|
|
// Loading JavaScript code - uncomment the one you want.
|
|
|
|
// OPTION 1
|
|
// Load from development server. Start the server from the repository root:
|
|
//
|
|
// $ npm start
|
|
//
|
|
// To run on device, change `localhost` to the IP address of your computer, and make sure your computer and
|
|
// iOS device are on the same Wi-Fi network.
|
|
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/SampleApp/index.ios.runModule.bundle"];
|
|
|
|
// OPTION 2
|
|
// Load from pre-bundled file on disk. To re-generate the static bundle, run
|
|
//
|
|
// $ curl http://localhost:8081/Examples/SampleApp/index.ios.runModule.bundle -o main.jsbundle
|
|
//
|
|
// and uncomment the next following line
|
|
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
rootView.scriptURL = jsCodeLocation;
|
|
rootView.moduleName = @"SampleApp";
|
|
|
|
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
|