Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The error "Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set" means your iOS app cannot find an initial view controller in the Main storyboard. Every storyboard used as the app's entry point must have exactly one view controller marked as the "Initial View Controller." This is set via the arrow indicator in Interface Builder or the "Is Initial View Controller" checkbox in the Attributes inspector.
The Error
This crash occurs at launch with a message like:
The app launches to a black screen or crashes immediately.
Fix 1: Set the Initial View Controller in Storyboard
- Open
Main.storyboardin Xcode - Select the view controller you want as the entry point
- Open the Attributes Inspector (right panel, shield icon)
- Check "Is Initial View Controller"
You should see a gray arrow pointing to that view controller on the canvas. If the arrow is missing, no initial view controller is set.
Alternatively, drag the arrow from empty space to the target view controller directly on the storyboard canvas.
Fix 2: Verify Info.plist Configuration
The storyboard filename must match what is specified in your project settings:
The value is the storyboard filename without the .storyboard extension. If your storyboard is named LaunchScreen.storyboard, the value should be LaunchScreen.
Check this in Xcode:
- Select your project in the navigator
- Select the target
- Go to the General tab
- Under Deployment Info, verify the Main Interface field shows the correct storyboard name
Fix 3: Set Entry Point Programmatically (No Storyboard)
If you prefer not to use a storyboard as the entry point, configure the root view controller in code:
UIKit (SceneDelegate)
Then remove the storyboard reference:
- Delete
UIMainStoryboardFilefromInfo.plist - In General > Deployment Info, clear the Main Interface field
- In the scene configuration in
Info.plist, remove the storyboard name entry
UIKit (AppDelegate, pre-iOS 13)
SwiftUI
SwiftUI apps using @main and App protocol do not use storyboards:
If you see this error in a SwiftUI project, make sure Info.plist does not contain a UIMainStoryboardFile entry from an old template.
Fix 4: Storyboard Reference Issues
If your storyboard uses storyboard references pointing to other storyboards:
Each referenced storyboard also needs its own initial view controller if you are using instantiateInitialViewController().
Fix 5: Clean Build and Derived Data
Sometimes stale build artifacts cause this error even when the storyboard is configured correctly:
Then rebuild the project (Cmd+B) and run again.
Checking Storyboard XML
If Interface Builder is not cooperating, verify the storyboard XML directly:
The initialViewController attribute on the root <document> element must match the id of one of the view controllers. If this attribute is missing, no initial view controller is set.
Common Pitfalls
- Deleting the initial view controller and forgetting to reassign: If you delete the view controller that was marked as initial and add a new one, you must re-check "Is Initial View Controller" on the replacement.
- Storyboard name mismatch: The
UIMainStoryboardFilevalue inInfo.plistmust exactly match the storyboard filename (without.storyboard). A typo like "main" instead of "Main" fails on case-sensitive file systems. - Multiple storyboards with no initial VC: If you split your app into multiple storyboards, each storyboard used with
instantiateInitialViewController()needs its own initial view controller. - SwiftUI projects with leftover storyboard references: When converting from UIKit to SwiftUI, remove
UIMainStoryboardFilefromInfo.plistand clear the Main Interface field in target settings. - Corrupted storyboard file: Merge conflicts in
.storyboardXML can remove theinitialViewControllerattribute. After resolving merge conflicts, always verify the initial view controller is still set.
Summary
- The error means no view controller is marked as the initial entry point in the storyboard
- Check "Is Initial View Controller" in the Attributes Inspector for the target view controller
- Verify
UIMainStoryboardFileinInfo.plistmatches your storyboard filename - For programmatic setup, remove storyboard references and set
window.rootViewControllerin SceneDelegate or AppDelegate - Clean derived data if the configuration looks correct but the error persists

