Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a Navigation Bar to a UITableViewController in Interface Builder?

Interface builder does not let me click and drag a Navigation Bar onto a Table View Controller!!! It is super frustrating.

All I want is a table view with an edit button (done in interface-builder). If this is not possible, then how do I add a navbar progammatically?

Thanks in advance.

like image 855
rustybeanstalk Avatar asked Feb 21 '11 16:02

rustybeanstalk


People also ask

How do you add navigation to a storyboard?

Go to the Storyboard. Select the View Controller and in The Editor menu select Embed in -> Navigation Controller. Next, drag a Bar Button from the Object Library to the left side of the Navigation Bar and name it "Left Item". Repeat this for the right side and name it "Right Item".

How do I embed navigation controller in storyboard?

In your storyboard, select the initial view controller in your hierarchy. With this view controller selected, choose the menu item Editor -> Embed In -> Navigation Controller .


1 Answers

From the outline view, make sure your Table View Controller is selected.

Then go to the Editor menu, and click on the Embed In submenu, and choose Navigation Controller and voila. You have your navigation controller pointing to your tableview controller with a relationship built in.

like image 62
Greeso Avatar answered Sep 29 '22 06:09

Greeso