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,KAAK,CAAC,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 <devic
|