Badr Filali
Badr Filali

Reputation: 300

PushViewController didn't work

I have a simple app, with only 2 empty page, the first one have a button, for call an action, with the code:

let story = UIStoryboard.init(name: "Main", bundle: nil)
let vc = story.instantiateViewController(withIdentifier: "testId")
self.navigationController?.pushViewController(vc, animated: true)

My second page got for Id "testId", it's two new page, I don't change param, or nothing else.

Upvotes: 1

Views: 1204

Answers (1)

Tushar Raikwar
Tushar Raikwar

Reputation: 46

Please make sure your first view controller has a navigation controller embedded with it,as pushing the view controller require a navigation controller'.It will surely work then.

Upvotes: 3

Related Questions