From a642f52d519543d9ece4bb525e99ebc281fa6887 Mon Sep 17 00:00:00 2001 From: Leon Jiang Date: Wed, 24 Jun 2020 00:23:26 -0700 Subject: initial commit, add react-native/typescript boilerplate --- ios/Frontend/AppDelegate.h | 8 +++ ios/Frontend/AppDelegate.m | 58 ++++++++++++++++++++++ ios/Frontend/Base.lproj/LaunchScreen.xib | 42 ++++++++++++++++ .../AppIcon.appiconset/Contents.json | 38 ++++++++++++++ ios/Frontend/Images.xcassets/Contents.json | 6 +++ ios/Frontend/Info.plist | 57 +++++++++++++++++++++ ios/Frontend/main.m | 9 ++++ 7 files changed, 218 insertions(+) create mode 100644 ios/Frontend/AppDelegate.h create mode 100644 ios/Frontend/AppDelegate.m create mode 100644 ios/Frontend/Base.lproj/LaunchScreen.xib create mode 100644 ios/Frontend/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios/Frontend/Images.xcassets/Contents.json create mode 100644 ios/Frontend/Info.plist create mode 100644 ios/Frontend/main.m (limited to 'ios/Frontend') diff --git a/ios/Frontend/AppDelegate.h b/ios/Frontend/AppDelegate.h new file mode 100644 index 00000000..ef1de86a --- /dev/null +++ b/ios/Frontend/AppDelegate.h @@ -0,0 +1,8 @@ +#import +#import + +@interface AppDelegate : UIResponder + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/ios/Frontend/AppDelegate.m b/ios/Frontend/AppDelegate.m new file mode 100644 index 00000000..0b7cba69 --- /dev/null +++ b/ios/Frontend/AppDelegate.m @@ -0,0 +1,58 @@ +#import "AppDelegate.h" + +#import +#import +#import + +#if DEBUG +#import +#import +#import +#import +#import +#import + +static void InitializeFlipper(UIApplication *application) { + FlipperClient *client = [FlipperClient sharedClient]; + SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; + [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; + [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; + [client addPlugin:[FlipperKitReactPlugin new]]; + [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; + [client start]; +} +#endif + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ +#if DEBUG + InitializeFlipper(application); +#endif + + RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + moduleName:@"Frontend" + 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 diff --git a/ios/Frontend/Base.lproj/LaunchScreen.xib b/ios/Frontend/Base.lproj/LaunchScreen.xib new file mode 100644 index 00000000..efc76e3a --- /dev/null +++ b/ios/Frontend/Base.lproj/LaunchScreen.xib @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Frontend/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/Frontend/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d3942e94 --- /dev/null +++ b/ios/Frontend/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Frontend/Images.xcassets/Contents.json b/ios/Frontend/Images.xcassets/Contents.json new file mode 100644 index 00000000..2d92bd53 --- /dev/null +++ b/ios/Frontend/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Frontend/Info.plist b/ios/Frontend/Info.plist new file mode 100644 index 00000000..75bf913c --- /dev/null +++ b/ios/Frontend/Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Frontend + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + + NSLocationWhenInUseUsageDescription + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/ios/Frontend/main.m b/ios/Frontend/main.m new file mode 100644 index 00000000..b1df44b9 --- /dev/null +++ b/ios/Frontend/main.m @@ -0,0 +1,9 @@ +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} -- cgit v1.2.3-70-g09d2