diff options
Diffstat (limited to 'ios/10lesson')
| -rw-r--r-- | ios/10lesson/AppDelegate.h | 9 | ||||
| -rw-r--r-- | ios/10lesson/AppDelegate.m | 82 | ||||
| -rw-r--r-- | ios/10lesson/Images.xcassets/AppIcon.appiconset/Contents.json | 38 | ||||
| -rw-r--r-- | ios/10lesson/Images.xcassets/Contents.json | 6 | ||||
| -rw-r--r-- | ios/10lesson/Images.xcassets/SplashScreen.imageset/Contents.json | 21 | ||||
| -rw-r--r-- | ios/10lesson/Images.xcassets/SplashScreen.imageset/splashscreen.png | bin | 0 -> 9306 bytes | |||
| -rw-r--r-- | ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/Contents.json | 21 | ||||
| -rw-r--r-- | ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/background.png | bin | 0 -> 80 bytes | |||
| -rw-r--r-- | ios/10lesson/Info.plist | 55 | ||||
| -rw-r--r-- | ios/10lesson/SplashScreen.storyboard | 91 | ||||
| -rw-r--r-- | ios/10lesson/Supporting/Expo.plist | 10 | ||||
| -rw-r--r-- | ios/10lesson/main.m | 10 |
12 files changed, 343 insertions, 0 deletions
diff --git a/ios/10lesson/AppDelegate.h b/ios/10lesson/AppDelegate.h new file mode 100644 index 0000000..f7d2972 --- /dev/null +++ b/ios/10lesson/AppDelegate.h @@ -0,0 +1,9 @@ +#import <Foundation/Foundation.h> +#import <React/RCTBridgeDelegate.h> +#import <UIKit/UIKit.h> + +#import <Expo/Expo.h> + +@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate> + +@end diff --git a/ios/10lesson/AppDelegate.m b/ios/10lesson/AppDelegate.m new file mode 100644 index 0000000..1b72e8c --- /dev/null +++ b/ios/10lesson/AppDelegate.m @@ -0,0 +1,82 @@ +#import "AppDelegate.h" + +#import <React/RCTBridge.h> +#import <React/RCTBundleURLProvider.h> +#import <React/RCTRootView.h> +#import <React/RCTLinkingManager.h> +#import <React/RCTConvert.h> + +#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>) +#import <FlipperKit/FlipperClient.h> +#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h> +#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h> +#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h> +#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h> +#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h> + +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 defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>) + InitializeFlipper(application); +#endif + + RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil]; + id rootViewBackgroundColor = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTRootViewBackgroundColor"]; + if (rootViewBackgroundColor != nil) { + rootView.backgroundColor = [RCTConvert UIColor:rootViewBackgroundColor]; + } 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]; + + [super application:application didFinishLaunchingWithOptions:launchOptions]; + + return YES; + } + +- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge +{ + // If you'd like to export some custom RCTBridgeModules, add them here! + return @[]; +} + +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { + #ifdef DEBUG + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; + #else + return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + #endif +} + +// Linking API +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { + return [RCTLinkingManager application:application openURL:url options:options]; +} + +// Universal Links +- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { + return [RCTLinkingManager application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]; +} + +@end diff --git a/ios/10lesson/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/10lesson/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..bf722cb --- /dev/null +++ b/ios/10lesson/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" : "expo" + } +}
\ No newline at end of file diff --git a/ios/10lesson/Images.xcassets/Contents.json b/ios/10lesson/Images.xcassets/Contents.json new file mode 100644 index 0000000..ed285c2 --- /dev/null +++ b/ios/10lesson/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "expo" + } +} diff --git a/ios/10lesson/Images.xcassets/SplashScreen.imageset/Contents.json b/ios/10lesson/Images.xcassets/SplashScreen.imageset/Contents.json new file mode 100644 index 0000000..e67cd6c --- /dev/null +++ b/ios/10lesson/Images.xcassets/SplashScreen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "splashscreen.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "expo" + } +}
\ No newline at end of file diff --git a/ios/10lesson/Images.xcassets/SplashScreen.imageset/splashscreen.png b/ios/10lesson/Images.xcassets/SplashScreen.imageset/splashscreen.png Binary files differnew file mode 100644 index 0000000..cc94f37 --- /dev/null +++ b/ios/10lesson/Images.xcassets/SplashScreen.imageset/splashscreen.png diff --git a/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/Contents.json b/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/Contents.json new file mode 100644 index 0000000..b5914aa --- /dev/null +++ b/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "background.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "expo" + } +}
\ No newline at end of file diff --git a/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/background.png b/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/background.png Binary files differnew file mode 100644 index 0000000..ff3dd16 --- /dev/null +++ b/ios/10lesson/Images.xcassets/SplashScreenBackground.imageset/background.png diff --git a/ios/10lesson/Info.plist b/ios/10lesson/Info.plist new file mode 100644 index 0000000..9f116db --- /dev/null +++ b/ios/10lesson/Info.plist @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>NSAppTransportSecurity</key> + <dict> + <key>NSAllowsArbitraryLoads</key> + <true/> + <key>NSExceptionDomains</key> + <dict> + <key>localhost</key> + <dict> + <key>NSExceptionAllowsInsecureHTTPLoads</key> + <true/> + </dict> + </dict> + </dict> + <key>UILaunchStoryboardName</key> + <string>SplashScreen</string> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UIViewControllerBasedStatusBarAppearance</key> + <false/> + <key>UIStatusBarStyle</key> + <string>UIStatusBarStyleDefault</string> +</dict> +</plist> diff --git a/ios/10lesson/SplashScreen.storyboard b/ios/10lesson/SplashScreen.storyboard new file mode 100644 index 0000000..24eec3d --- /dev/null +++ b/ios/10lesson/SplashScreen.storyboard @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document + type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" + version="3.0" + toolsVersion="16096" + targetRuntime="iOS.CocoaTouch" + propertyAccessControl="none" + useAutolayout="YES" + launchScreen="YES" + useTraitCollections="YES" + useSafeAreas="YES" + colorMatched="YES" + initialViewController="EXPO-VIEWCONTROLLER-1" +> + <device id="retina5_5" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="EXPO-SCENE-1"> + <objects> + <viewController + storyboardIdentifier="SplashScreenViewController" + id="EXPO-VIEWCONTROLLER-1" + sceneMemberID="viewController" + > + <view + key="view" + userInteractionEnabled="NO" + contentMode="scaleToFill" + insetsLayoutMarginsFromSafeArea="NO" + id="EXPO-ContainerView" + userLabel="ContainerView" + > + <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <subviews> + <imageView + userInteractionEnabled="NO" + contentMode="scaleAspectFill" + horizontalHuggingPriority="251" + verticalHuggingPriority="251" + insetsLayoutMarginsFromSafeArea="NO" + image="SplashScreenBackground" + translatesAutoresizingMaskIntoConstraints="NO" + id="EXPO-SplashScreenBackground" + userLabel="SplashScreenBackground" + > + <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> + </imageView> + <imageView + clipsSubviews="YES" + userInteractionEnabled="NO" + contentMode="scaleAspectFit" + horizontalHuggingPriority="251" + verticalHuggingPriority="251" + translatesAutoresizingMaskIntoConstraints="NO" + image="SplashScreen" + id="EXPO-SplashScreen" + userLabel="SplashScreen" + > + <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> + </imageView> + </subviews> + <constraints> + <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="1gX-mQ-vu6"/> + <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="leading" secondItem="EXPO-ContainerView" secondAttribute="leading" id="6tX-OG-Sck"/> + <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="trailing" secondItem="EXPO-ContainerView" secondAttribute="trailing" id="ABX-8g-7v4"/> + <constraint firstItem="EXPO-SplashScreenBackground" firstAttribute="bottom" secondItem="EXPO-ContainerView" secondAttribute="bottom" id="jkI-2V-eW5"/> + <constraint firstItem="EXPO-SplashScreen" firstAttribute="top" secondItem="EXPO-ContainerView" secondAttribute="top" id="2VS-Uz-0LU"/> + <constraint firstItem="EXPO-SplashScreen" firstAttribute="leading" secondItem="EXPO-ContainerView" secondAttribute="leading" id="LhH-Ei-DKo"/> + <constraint firstItem="EXPO-SplashScreen" firstAttribute="trailing" secondItem="EXPO-ContainerView" secondAttribute="trailing" id="I6l-TP-6fn"/> + <constraint firstItem="EXPO-SplashScreen" firstAttribute="bottom" secondItem="EXPO-ContainerView" secondAttribute="bottom" id="nbp-HC-eaG"/> + </constraints> + <viewLayoutGuide key="safeArea" id="Rmq-lb-GrQ"/> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="EXPO-PLACEHOLDER-1" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="140.625" y="129.4921875"/> + </scene> + </scenes> + <resources> + <image name="SplashScreen" width="414" height="736"/> + <image name="SplashScreenBackground" width="1" height="1"/> + </resources> +</document> diff --git a/ios/10lesson/Supporting/Expo.plist b/ios/10lesson/Supporting/Expo.plist new file mode 100644 index 0000000..03410dc --- /dev/null +++ b/ios/10lesson/Supporting/Expo.plist @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>EXUpdatesSDKVersion</key> + <string>YOUR-APP-SDK-VERSION-HERE</string> + <key>EXUpdatesURL</key> + <string>YOUR-APP-URL-HERE</string> +</dict> +</plist> diff --git a/ios/10lesson/main.m b/ios/10lesson/main.m new file mode 100644 index 0000000..25181b6 --- /dev/null +++ b/ios/10lesson/main.m @@ -0,0 +1,10 @@ +#import <UIKit/UIKit.h> + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} + |
