Reputation: 105
Hi my app is made without a storyboard and in one of my classes I want to present the one controller made in my storyboard but it crashes every time here are some screen shots
[!][This is how im presenting it2]2
Upvotes: 0
Views: 41
Reputation: 271420
If you want to present something that is in the storyboard, you need to instantiate the VC class using instantiateViewController(withIdentifier:)
:
let newNoteVC = UIStoryboard.main.
instantiateViewController(withIdentifier: "A")
"A"
is the storyboard ID that you gave the VC.
Now it can be presented:
present(newNoteVC, animated: true, completion: nil)
Upvotes: 1