pushViewController without navigationcontroller

You can't push a view controller onto a navigation controller if there is no navigation controller. If you are wanting to be pushing controllers and have it display the topmost controller and everything, just use a UINavigationController and be done with it.

You can push arbitrary UINavigationItems onto your UINavigationBar, and your bar's delegate will be notified when the user uses the back button so you can take appropriate action. See the documentation for more information.


What could also be done is to use a Navigation Controller as usual and then hide it.

To hide the Navigation Controller using storyboards: select it and uncheck "Show Navigation Bar" in the attribute inspector. Others might suggest to hide the navigation bar in each controller, but the problem with that is that it will appear for a millisecond and then disappear.

Navigation Controller attributes tab


I would wrap the UITableView inside a UINavigationController and just hide the UINavigationBar.

[self.navigationController setNavigationBarHidden:YES animated:NO];

And then create a back button that pops the ViewController off the stack.

[self.navigationController popViewControllerAnimated:YES]

The closest alternative if you don't want to use navigation controller are modal view controllers.

[self presentViewController:controller animated:YES completion:nil];

This will slide the controller into your screen from bottom, or if you change controller's modalTransitionStyle it can flip over or fade in.

To dismiss the controller just call:

[self dismissViewControllerAnimated:YES completion:nil];