0

I have a tableview in my iOS app using Xcode 6 and swift I try drag and drop a Tool bar to my table view in Story board.

But it does not go under TableView as the children of TableView. And I don't see it show up on screen when I run the app on simulator.

enter image description here

How can I add a ToolBar to the Tableview in my iOS application.

pkamb
  • 33,281
  • 23
  • 160
  • 191
hap497
  • 154,439
  • 43
  • 83
  • 99

3 Answers3

0

You should embed it into a Navigation Controller.

Select your view, go to Editor > Embed in > Navigation Controller .

derdida
  • 14,784
  • 16
  • 90
  • 139
  • Why should that not work? Same answers here, and i did that 1000 times. http://stackoverflow.com/questions/5068659/how-do-i-add-a-navigation-bar-to-a-uitableviewcontroller-in-interface-builder – derdida Oct 29 '14 at 08:11
  • Sorry about that, it didn't work for me the first time and I kinda rushed on the downvote button. –  Oct 29 '14 at 08:14
0

That's because you can't add a toolbar to a table view, if you want to do so you have to embed both the table view and the toolbar inside a "View" element, which will then allow to drag in and reposition whatever element you want inside it.

Here's how your scene should look like, note that both the table view and the toolbar are inside a view :

Scene screenshot

0

You can add toolbar in UITableView Header View. Just drag and drop ToolBar in UITableView

I tried in Xcode version 11.3. You can see ToolBar under UITableViewCell

enter image description here