Reputation: 2349
As my screen have static options, so I created a screen with static cells from UITableViewController
class instead of UIViewController
Now When I'm trying to add the Navigation bar from storyboard it never adds above UITableView
. Always added at the footer of the table view.
Can we add without programmatically?
Please refer screenshot:
Appreciate your help!
Thanks
Upvotes: 0
Views: 804
Reputation: 1218
In Storyboard, you can't add any other view at the same level of the TableView in TableViewController, so adding UINavigationBar won't work here.
You can show navigation bar using UINavigationController:
In Storyboard first, select your Table View Controller.
Then Open Editor menu, and select Embed In option, and choose Navigation Controller. You will get your navigation controller pointing to your tableview controller.
Upvotes: 1
Reputation: 151
A simple way is that you can embed your UITableViewController in a UINavigationController:
The second solution is to add it programmatically, as you just said.
Upvotes: 0
Reputation: 107
To solve your problem, you can embed your UiTableViewController in a UINavigationController from storyboard.
Just add a UINavigationController on the storyboard and drag to your UITableviewController and set it as either root or push.
You dont have to manually add the UINavigationBar.
Hope this helps.
Upvotes: 0