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AC,gBAAgB,UAAU,qCAAqC,CAAC,CAAC;KACpF;IAED,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;IAC5E,MAAM,kCAAqB,CACzB,QAAQ,EACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsDY,CAAC,wBAAwB;QACvB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;;;+BAIW,WAAW;;;;;;;;;2BAU5B;;;;;;sKAOE,CAAC,wBAAwB;QACvB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;;;2JAKN;;;;;;;;;;eAWV,CAAC,wBAAwB;QACvB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;0DAEN;;;;CAID,CACE,CAAC;IAEF,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC;AArID,sCAqIC","sourcesContent":["import path from 'path';\n\nimport { SplashScreenImageResizeMode, SplashScreenImageResizeModeType } from '../constants';\nimport { createDirAndWriteFile } from '../utils/file-utils';\nimport { addStoryboardFileToProject } from '../xcode';\nimport { IosProject } from './pbxproj';\n\nconst STORYBOARD_FILE_PATH = './SplashScreen.storyboard';\n\n/**\n * Modifies `.pbxproj` by:\n * - adding reference for `.storyboard` file\n */\nfunction updatePbxProject({ projectName, pbxProject, applicationNativeTarget }: IosProject): void {\n // Check if `${projectName}/SplashScreen.storyboard` already exists\n // Path relative to `ios` directory\n const storyboardFilePath = path.join(projectName, STORYBOARD_FILE_PATH);\n if (!pbxProject.hasFile(storyboardFilePath)) {\n const group = pbxProject.findPBXGroupKey({ name: projectName });\n if (!group) {\n throw new Error(`Couldn't locate proper PBXGroup '.xcodeproj' file.`);\n }\n addStoryboardFileToProject(pbxProject, storyboardFilePath, {\n target: applicationNativeTarget.uuid,\n group,\n });\n }\n}\n\n/**\n * Creates [STORYBOARD] file containing ui description of Splash/Launch Screen.\n * > WARNING: modifies `pbxproj`\n */\nexport default async function configureStoryboard(\n iosProject: IosProject,\n config: {\n imageResizeMode?: SplashScreenImageResizeModeType;\n image?: string;\n } = {}\n) {\n const resizeMode: SplashScreenImageResizeModeType =\n config.imageResizeMode ?? SplashScreenImageResizeMode.CONTAIN;\n const splashScreenImagePresent = Boolean(config.image);\n\n let contentMode: string;\n switch (resizeMode) {\n case SplashScreenImageResizeMode.CONTAIN:\n contentMode = 'scaleAspectFit';\n break;\n case SplashScreenImageResizeMode.COVER:\n contentMode = 'scaleAspectFill';\n break;\n default:\n throw new Error(`resizeMode = ${resizeMode} is not supported for iOS platform.`);\n }\n\n const filePath = path.resolve(iosProject.projectPath, STORYBOARD_FILE_PATH);\n await createDirAndWriteFile(\n filePath,\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document\n type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\"\n version=\"3.0\"\n toolsVersion=\"16096\"\n targetRuntime=\"iOS.CocoaTouch\"\n propertyAccessControl=\"none\"\n useAutolayout=\"YES\"\n launchScreen=\"YES\"\n useTraitCollections=\"YES\"\n useSafeAreas=\"YES\"\n colorMatched=\"YES\"\n initialViewController=\"EXPO-VIEWCONTROLLER-1\"\n>\n <device id=\"retina5_5\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"16087\"/>\n <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"EXPO-SCENE-1\">\n <objects>\n <viewController\n storyboardIdentifier=\"SplashScreenViewController\"\n id=\"EXPO-VIEWCONTROLLER-1\"\n sceneMemberID=\"viewController\"\n >\n <view\n key=\"view\"\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleToFill\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n id=\"EXPO-ContainerView\"\n userLabel=\"ContainerView\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n <subviews>\n <imageView\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleAspectFill\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n image=\"SplashScreenBackground\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n id=\"EXPO-SplashScreenBackground\"\n userLabel=\"SplashScreenBackground\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>${\n !splashScreenImagePresent\n ? ''\n : `\n <imageView\n clipsSubviews=\"YES\"\n userInteractionEnabled=\"NO\"\n contentMode=\"${contentMode}\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n image=\"SplashScreen\"\n id=\"EXPO-SplashScreen\"\n userLabel=\"SplashScreen\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>`\n }\n </subviews>\n <constraints>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"1gX-mQ-vu6\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"6tX-OG-Sck\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"ABX-8g-7v4\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"jkI-2V-eW5\"/>${\n !splashScreenImagePresent\n ? ''\n : `\n <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"LhH-Ei-DKo\"/>\n <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"I6l-TP-6fn\"/>\n <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"nbp-HC-eaG\"/>`\n }\n </constraints>\n <viewLayoutGuide key=\"safeArea\" id=\"Rmq-lb-GrQ\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"EXPO-PLACEHOLDER-1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"140.625\" y=\"129.4921875\"/>\n </scene>\n </scenes>\n <resources>${\n !splashScreenImagePresent\n ? ''\n : `\n <image name=\"SplashScreen\" width=\"414\" height=\"736\"/>`\n }\n <image name=\"SplashScreenBackground\" width=\"1\" height=\"1\"/>\n </resources>\n</document>\n`\n );\n\n await updatePbxProject(iosProject);\n}\n"]} |