Files
pezkuwi-ui/packages/exampleReactNative/ios/exampleReactNative/AppDelegate.m
T
Cameron Franz b3e9b70341 react-native example app port (#223)
* add readme

* react-native example app

* update readme

* add ios-cli dep

* revert package.json change

* update readme

* update readme

* don't auto launch metro

* add react native scripts

* nohoist @react-native-community/**

* update readme

* undo wrong README change

* remove react-native root dep

* copyright headers

* semi-style

* add default gitignore

* finish linting

* remove test for now

* fix typescript errors

* fix linting

* update scripts

* update deps and version

* update readme

* remove accidental dep

* update readme

* bump deps

* update yarn.lock

* actually update yarn.lock

* fix yarn.lock conflicts by updating exampleReactNative deps
2019-10-10 21:22:21 +02:00

43 lines
1.4 KiB
Objective-C

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"exampleReactNative"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end