This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

26 lines
983 B
JavaScript
Raw Normal View History

2021-04-02 02:24:13 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addStoryboardFileToProject = void 0;
/**
* @param filePath
* @param param1.target PBXNativeTarget reference
* @param param1.group PBXGroup reference
*/
function addStoryboardFileToProject(pbxProject, filePath, { target, group }) {
const file = pbxProject.addFile(filePath, group, {
lastKnownFileType: 'file.storyboard',
defaultEncoding: 4,
target,
});
if (!file) {
throw new Error('File already exists in the project');
}
delete pbxProject.pbxFileReferenceSection()[file.fileRef].explicitFileType;
delete pbxProject.pbxFileReferenceSection()[file.fileRef].includeInIndex;
file.uuid = pbxProject.generateUuid();
file.target = target;
pbxProject.addToPbxBuildFileSection(file);
pbxProject.addToPbxResourcesBuildPhase(file);
}
exports.addStoryboardFileToProject = addStoryboardFileToProject;
//# sourceMappingURL=index.js.map