I have started a new app a few days ago and began working with the simulator to test it. I started as an empty project and manually added the storyboard. The simulator builds and runs my app just fine but when I try to build to my iPhone I get the messsage 'Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle'.
Google turned up nothing and this question suggested I checked my target for the storyboard, but everything is in place. Even so, if something wouldn't be in place, the simulator wouldn't run either.
Can anyone point me in the right direction?
You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.
If you're using XCode 11.4. 1, try to find LaunchScreen. storyboard instead in the project navigator.
there is a key in plist file and under "Targets" -> Custom iOS Target Properties "Main storyboard file base name". There default is "Main". So if you want any other storyboard, replace "Main" with your file name. By selecting storyboard from main interface, in plist, it automatically changed.
If you go over to the project outline and control click on the storyboard file and hold down the cursor, you will see the option to open as, this will let you open the storyboard as a certain type. Click on that and choose open as story board. Good luck!
I had my app working normally on the iPhone Simulator but strangely Xcode stopped responding and i had to Force Quit Xcode. When I restarted Xcode i encountered "Could not find a storyboard named MainStoryboard....",
I have fixed this issue by following below steps:
For some reason the file "MainStoryboard.storyboard" was not recognised after force quitting Xcode and following above steps made the app recognise the file back again.
Hope this solution helps..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With