user3863704
user3863704

Reputation: 191

Could not find a storyboard named 'Main' in bundle NSBundle

during the progress of my app I decided to change from using a UIStoryboard to .xib file, and now I get the error:

Could not find a storyboard named 'Main' in bundle NSBundle

How can I fix this problem within the Simulator part of my app?

Upvotes: 19

Views: 21578

Answers (4)

Zeeshan Habib
Zeeshan Habib

Reputation: 1

Add these line to your action method

Where "Main" will be same as it as

let storyboard = UIStoryboard.init(name: "Main", bundle: nil)

let secondVc = storyboard.instantiateViewController(withIdentifier: "ControllerName") as! ControllerName

present(secondVc, animated: true, completion: nil)

Upvotes: 0

benmore99
benmore99

Reputation: 933

if you are using SceneDelegate in iOS13, Try to remove this key.

Main storyboard in UIScene

Upvotes: 16

Vicky
Vicky

Reputation: 1095

Click Your Story board

then do step 2 and step 3

enter image description here

Upvotes: 9

Hemant Chittora
Hemant Chittora

Reputation: 3162

Remove the "Main storyboard file base name" or "UIMainStoryboardFile" Key from your info.plist file.

info.plist

Upvotes: 46

Related Questions