Is there anyone who uses storyboard for their iOS app’s launch screen? Every time when I save my project in the Projucer, it messes up the storyboard’s fileRef number in /project.pbxproj so the launch screen cannot be shown. Then I have to manually change those fileRef numbers in /project.pbxproj to make the launch screen work.
In the exporter configuration page of Projucer, I have included the storyboard in “Custom Xcode Resource folders”, and added it in the “Custom Plist” as
Thanks for your reply. I believe you meant this post right?
I think I did the same thing as you said. Or do you mean instead of adding LaunchScreen.storyboard in “Custom Xcode Resource folders” under iOS exporter configuration, I should add it under File explorer->Resources ?
Apologies for not reading the OP fully, I just saw the latest post and thought the new additions might be of use. I’m not seeing this problem if I use the latest Projucer though - I’ve added a MyStoryboard.storyboard file to a test project like so:
And after “save & open in IDE” I did see my storyboard under resources in Xcode:
But the launch screen didn’t show up. It behaved exactly the same as what I described in my first post (what I did then was adding MyStoryboard.storyboard to the “Custom Xcode Resource Folders” field in the iOS exporter).
To make the storyboard work right, I need to add that storyboard manually in Xcode. But the problem is that every time when I save in the Producer, it got messed up.
@matkatmusic 's solution works for me but the only small issue is that I’ve been needing to delete the storyboard when I build the macOS app. Hope that clarifies it.
So the “Launch Screen File” setting in Xcode is displaying the custom storyboard that you specified in the Projucer and the .storyboard file shows up in the “Resources” folder, but it’s not displaying when you start the app? Can you try completely removing the Builds folder of your project and re-saving?
Ah, I see what’s happening now. The folders specified in “Custom Xcode Resource Folders” are added to the project as folder references so the target membership is set for the whole folder and not the individual files within the folder, which is why the file isn’t being picked up by Xcode.
Unfortunately I can’t see a simple way to work around this so for the time being it looks like you’ll need to add the .storyboard file as an “Xcode Resource” in the Projucer and then delete the file from macOS builds as you were doing before. I’ll try to come up with a nicer solution…
That makes sense. Cause I used to add my storyboard in “Custom Xcode Resource Folders” and applied a patch I created which changes the storyboard’s fileRef number in /project.pbxproj to make launch screen display correctly, until @matkatmusic gave his solution.
Thank you very much for your help! Hope there will be a nicer solution.
In a similar vein/to support this thread, I have the LaunchScreen.storyboard added as an Xcode resource in ProJucer. The same name applied in the iOS exporter for Custom Launch Storyboard.
This works fine for iOS work. When I want to switch over to MacOS testing I get the understandable error iOS storyboards do not support target device type “Mac”. Which makes sense. What I then do is go to the Inspector for the LaunchScreen.storyboard and uncheck Target Membership for the App that I’m building. This works fine but seems like a silly step.
So I wonder if it’s possible to define resources in the exporter sections (perhaps as a list of names per Custom Launch Storyboard) that you now want excluded from target membership, or just excluded from the Xcode project altogether. Either works for me.
Does this seem like a fair ask? Is it already being worked on?
This experience was had on ProJucer 5.4.3 and the Dev branch.
Well, when Apple switched from xcassets to storyboards, the iOS side of the ProJucer didn’t really keep up… They’re busy with SOUL, anyway…
Just separate out your iOS specific files from your OS X/Windows specific files from your common files, and make separate Jucer projects for the time being. it’s the simplest thing to do for the time being.