nburk nburk - 5 months ago 43
iOS Question

Prevent UITableView from receiving two touches (nested pop animation can result in corrupted navigation bar)

I am using a

in my app, which when tapped will use
to push another view controller onto the navigation controller's view controller stack.

However, when a cell on the tableview is double †apped,
gets called twice, causing the navigation controller to push two of these new viewcontroller s on the stack and resulting in the following console output:

nested pop animation can result in corrupted navigation bar
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

It's not a very important issue, because users are not very likely to perform a double tap on the table view cells, however I was wondering if there is an elegant solution to prevent this kind of misnavigation? (maybe checking the navigation controller's
and subsequently decide whether the push
method should actually be performed?).


Here is one line solution

self.tableView.multipleTouchEnabled = NO;