0

My UITableview is inside a container (one that requires an embed segue, so I can use static table view cells) and the parent view controller's parent is a UIViewcontroller container.

Why would a row on the table view require a very long press to trigger a segue?

If I remove the parent UIViewcontroller container, then it works OK.

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
  • 1
    Hard to say. But to me happened once that an added (tap)gesture recognizer conflicted with table view resulting into something similar you're describing. – Au Ris Sep 05 '17 at 21:19
  • Yes, that is it. How would I give the tableview priority? – Ian Warburton Sep 05 '17 at 21:31
  • 1
    In my case I removed the gesture recognizer as it was not meant to be there while the tableview was visible. For you this looks like the answer you need https://stackoverflow.com/questions/8192480/uitapgesturerecognizer-breaks-uitableview-didselectrowatindexpath – Au Ris Sep 05 '17 at 21:35
  • 1
    Yup, that's what I've done. The top level view controller container is a login screen and the tap recognizer is to close it. So I've enabled it only when the login screen is visible. – Ian Warburton Sep 05 '17 at 21:40

1 Answers1

0

The delay could be the delay incurred in order to detect which subview you have touched.

When you touch any where in your window in your app, the app's window calls hitTest:withEvent: method on the top-most view in the view hierarchy, which recursively calls hitTest:withEvent: for its subviews to finally detect the view that actually receives and handles the touch event. So basically the more number of subview in your view controller, the more delay it will introduce for the actual view to respond. The recursive calls to hitTest:withEvent: return a bit delayed, that's why you are seeing the delay. Removing your parent view controller will not add much of a delay, because you reduce the number of subviews for the view controller. Also when there are more scroll views (or more subviews in general) involved you give the UIResponder to traverse through more subviews to return the view that handles the touch event.

badhanganesh
  • 3,427
  • 3
  • 18
  • 39