Max
Max

Reputation: 1349

How to correctly push to another Navigation Controller

I have some VC which should push to ANOTHER Navigation Controller. If I do just

self.navigationController?.pushViewController(self.storyboard!.instantiateViewControllerWithIdentifier("someID") as someVC, animated: true)

this is not working. I can add

    dispatch_async(dispatch_get_main_queue()) { 
         self.navigationController?.pushViewController(self.storyboard!.instantiateViewControllerWithIdentifier("someID") as someVC, animated: true)
    }

So it works but as I know it's not correctly way to use it. What I should use? presentViewController ?

Upvotes: 3

Views: 3963

Answers (1)

dev_mush
dev_mush

Reputation: 2196

You should push only UIViewController subclasses inside a navigation controller. This question might help!

Upvotes: 1

Related Questions