UIToolBar buttons don't work over UITableView

171 views Asked by At

I have a UITableView inside the ViewController, on top of it there is a UIToolbar.

enter image description here

A button image is placed inside the Toolbar, as shown in the image. What is weird is that when I click that button nothing happens, it seems it's behind the TableView. I've tried sending back the TableView, like this:

view.sendSubviewToBack(tableView)

Simulated output:

enter image description here

But it did not work. What's wrong with my code?

1

There are 1 answers

1
Leo On BEST ANSWER

Because your toolbar is under tableview

Just change the order of toolbar