S
S
Stanislav Korolevskiy2016-05-03 12:20:14
Apple Xcode
Stanislav Korolevskiy, 2016-05-03 12:20:14

Why is static TableView not responsive?

There is a TableViewController with static table. When you click on one of the cells, you need to perform some action. In the properties of this cell, I allowed its selection. The cell is highlighted in color when clicked, but no action occurs (the didSelectRowAtIndexPath method does not respond). With delegate everything is all right.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManWithBear, 2016-05-03
@korolevsky_s

We make ourselves a delegate of your gestur. In the method
Return true/false depending on whether the keyboard is on the screen.

S
Stanislav Korolevskiy, 2016-05-03
@korolevsky_s

Update! By trial and error, I figured out that the problem is in the method:

let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(MainTableViewController.dismissKeyboard))
        view.addGestureRecognizer(tap)

Can it be replaced by another? It is very necessary that the keyboard disappear when you click in any area

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question