You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

新Xcode项目中Main.storyboard文件未显示,寻求技术解决方案

Hey there! Let’s figure out why your new Xcode project isn’t showing the Main.storyboard file—this is super common with newer Xcode versions, so you’re not alone.

Why Main.storyboard Is Missing

Newer Xcode templates (14+) prioritize code-based or SwiftUI setups by default, which skip storyboards entirely:

  • If you picked the iOS App template and chose SwiftUI as your interface, Xcode uses ContentView.swift as the starting point instead of a storyboard.
  • For UIKit projects, the default setup now uses programmatic window/scene configuration (via ViewController.swift and scene delegates) instead of relying on storyboards.
How to Get Main.storyboard Back

You’ve got a few options depending on whether you want to fix your existing project or start fresh:

Option 1: Add a Storyboard to Your Existing Project

If you want to keep your current project and add Main.storyboard manually:

  • Right-click your project folder in the Project Navigator → New File.
  • Under the iOS section, select User Interface → Storyboard, then click Next.
  • Name the file Main, double-check it’s added to your project target, and click Create.
  • Now set it as your app’s main interface:
    1. Select the top-most project item in the Project Navigator (your project name).
    2. Switch to the Info tab.
    3. Scroll down to Application Scene Manifest → Scene Configuration → Application Session Role → Item 0 (Default Configuration).
    4. Replace the value for Storyboard Name with Main.
    5. If you’re working with an older project (pre-iOS 13) without scene configuration, look for Main storyboard file base name under Custom iOS Target Properties and set it to Main.

Option 2: Create a New Project with Storyboards

If you’d rather start over with a storyboard-based setup:

  • When creating a new project, select the iOS App template.
  • On the configuration screen, set Interface to Storyboard (instead of SwiftUI).
  • Fill in the rest of your project details and click Create—you’ll see Main.storyboard in the Project Navigator immediately.

Option 3: Check if It’s Hidden (Less Common)

Sometimes files get filtered out or misplaced:

  • Click the magnifying glass icon (Filter button) in the top-right of the Project Navigator.
  • Make sure "All" is selected, or search directly for Main.storyboard to see if it pops up.
  • Double-check all folders in your project navigator—maybe the file was accidentally added to a different group.

内容的提问来源于stack exchange,提问作者Siddhant Angore

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:13:42