In my UITableView
that I have setup using Storyboards, I need to be able to add a tool bar that sticks to the bottom of the view, it should not scroll.
Unlike this question: LINK I don't think I could add a TableView subview to a normal view and then just add a toolbar programmatically because I am using dynamic cells which seem a lot easier to integrate via Storyboards.
For now, this is what I am stuck with....
This remedy works for (2016) iOS 9.2. We all hate how Apple makes us waste time in stuff that should be straightforward like this. I like step by step solutions for this type of silly problems, so I will share it with you!:
In the viewDidLoad() method of your View controller, add this code before anything else:
//the rest of code }
You don't want that toolbar hanging around elsewhere, so add this inside your view to hide it once the current window is dismissed:
-
Voila!
if you want show toolbar in one view controller which placed in some navigation controller.
code:
For Swift users, you can use the following code:
Although you won't be able to use UITableViewController as your linking class step 4 will allow you to link it to a regular UIViewController.
You'll need something like this in the header though
It'll look something like this in your storyboard:
I used an intermediate View Controller with a Container view to the table. Add the toolbar view to the intermediate, and make it look however you want (use UIButtons instead of UIBarButtonItem).
If you do this, have the container view stretch to the top of the screen and not the bottom of the nav bar or you'll pull your hair out trying to get the scroll insets right.
Some more details in a similar question https://stackoverflow.com/a/31878998/1042111
Very easy. Just click on the navigation controller. Then in Show Attributes Inspector then navigation controller then click on the shows toolbar. Check the screen shot.