diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index 2a836f3bbb..8ed0785be1 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -217,9 +217,9 @@ public: "a launch storyboard from being used."); props.add (new TextPropertyComponent (customLaunchStoryboardValue, "Custom Launch Storyboard", 256, false), - "If this field is not empty then the specified launch storyboard will be used for the app's launch screen, " - "otherwise a default blank launch storyboard will be generated. This should be the filename without the " - "\".storyboard\" extension and the file should be added to the project's Xcode resources."); + "If this field is not empty then the specified launch storyboard file will be added to the project as an Xcode " + "resource and will be used for the app's launch screen, otherwise a default blank launch storyboard will be used. " + "The file path should be relative to the project folder."); } props.add (new TextPropertyComponent (customXcodeResourceFoldersValue, "Custom Xcode Resource Folders", 8192, true), @@ -1442,7 +1442,8 @@ public: { auto customStoryboard = owner.getCustomLaunchStoryboardString(); - addPlistDictionaryKey (dict, "UILaunchStoryboardName", customStoryboard.isNotEmpty() ? customStoryboard + addPlistDictionaryKey (dict, "UILaunchStoryboardName", customStoryboard.isNotEmpty() ? customStoryboard.fromLastOccurrenceOf ("/", false, false) + .upToLastOccurrenceOf (".storyboard", false, false) : owner.getDefaultLaunchStoryboardName()); } } @@ -1911,8 +1912,17 @@ private: { addXcassets(); - if (getCustomXcassetsFolderString().isEmpty() && getCustomLaunchStoryboardString().isEmpty()) - writeDefaultLaunchStoryboardFile(); + if (getCustomXcassetsFolderString().isEmpty()) + { + auto customLaunchStoryboard = getCustomLaunchStoryboardString(); + + if (customLaunchStoryboard.isEmpty()) + writeDefaultLaunchStoryboardFile(); + else if (getProject().getProjectFolder().getChildFile (customLaunchStoryboard).existsAsFile()) + addLaunchStoryboardFileReference (RelativePath (customLaunchStoryboard, RelativePath::projectFolder) + .rebased (getProject().getProjectFolder(), getTargetFolder(), RelativePath::buildTargetFolder) + .toUnixStyle()); + } } else { @@ -3515,9 +3525,13 @@ private: overwriteFileIfDifferentOrThrow (storyboardFile, mo); - auto path = RelativePath (storyboardFile, getTargetFolder(), RelativePath::buildTargetFolder).toUnixStyle(); - auto refID = addFileReference (path); - auto fileID = addBuildFile (path, refID, false, false); + addLaunchStoryboardFileReference (RelativePath (storyboardFile, getTargetFolder(), RelativePath::buildTargetFolder).toUnixStyle()); + } + + void addLaunchStoryboardFileReference (const String& relativePath) const + { + auto refID = addFileReference (relativePath); + auto fileID = addBuildFile (relativePath, refID, false, false); resourceIDs.add (fileID); resourceFileRefs.add (refID);