2021-02-19 08:07:53 -07:00
|
|
|
/**
|
2021-06-01 05:07:57 -06:00
|
|
|
* Copyright (c) mrousavy
|
2021-02-19 08:07:53 -07:00
|
|
|
*
|
|
|
|
* 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>
|
2021-10-05 04:22:14 -06:00
|
|
|
#import <React/RCTRootView.h>
|
2021-02-19 08:07:53 -07:00
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
|
|
{
|
2021-10-05 04:22:14 -06:00
|
|
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
|
|
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
|
|
|
|
moduleName:@"VisionCameraExample"
|
|
|
|
initialProperties:nil];
|
2021-02-19 08:07:53 -07:00
|
|
|
|
2021-10-05 04:22:14 -06:00
|
|
|
if (@available(iOS 13.0, *)) {
|
|
|
|
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
|
|
} else {
|
|
|
|
rootView.backgroundColor = [UIColor whiteColor];
|
|
|
|
}
|
|
|
|
|
|
|
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
UIViewController *rootViewController = [UIViewController new];
|
|
|
|
rootViewController.view = rootView;
|
|
|
|
self.window.rootViewController = rootViewController;
|
|
|
|
[self.window makeKeyAndVisible];
|
|
|
|
return YES;
|
2021-02-19 10:02:24 -07:00
|
|
|
}
|
|
|
|
|
2021-02-19 08:07:53 -07:00
|
|
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
|
|
{
|
|
|
|
#if DEBUG
|
|
|
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
|
|
|
#else
|
|
|
|
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|