1

I have a ViewController and another second controller called FlavorsController. My ViewController is my initial view controller. It does not have a navigation controller. I go to the FlavorsController using the following command:

let controller = storyboard?.instantiateViewControllerWithIdentifier("FlavorsController") as! FlavorsController
        presentViewController(controller, animated: true, completion: nil)

I have a NavigationController that is set on FlavorsController however it is not showing up.

enter image description here

1
  • Create your segue between the two view controllers fist then when while clicked the second VC then click on Editor - Embed In - NavigationController. Commented Dec 2, 2015 at 20:48

1 Answer 1

3

You should present the Navigation Controller instead of the FlavorsController, so code should look like this:

let controller = storyboard?.instantiateViewControllerWithIdentifier("NavControllerID") as! NavBarControllerName
    presentViewController(controller, animated: true, completion: nil)

See that NavControllerID and NavBarControllerName are just names invented by me. Just set the ones you have set in your storyboard.

Sign up to request clarification or add additional context in comments.

1 Comment

did that the first time and it didn't work and when you told me, it did. I feel dumb. Thanks brother. I will accept answer soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.