0

I have a tableView where each cell triggers a modal view (it is a travel planner, the table is used to select origin and destination).

After selecting an address the modal is dismissed and the user is returned to the tableview. However, if I immediately select a cell the event is not recoginized, I need to wait a few seconds.

I've checked that neither shouldHighlightCellAtIndexPath or didSelectCellAtIndexPath is called.

After checking other questions here I also tried to set delaysContentTouches to false (for tableview and the embedded scrollview, see UIButton not showing highlight on tap in iOS7)

Do anyone know how I can make the tableview respond to selection immediately? The delay is just long enough to annoy the users

Community
  • 1
  • 1
mlidal
  • 1,111
  • 14
  • 27
  • 1
    are you dismissing this modal views with animated = true ? – Andrei Malygin Oct 21 '15 at 08:26
  • and next question - is there any complex code in viewWillAppear ? maybe your UI just become unresponsive because it is hands somewhere there on lock or something. – Andrei Malygin Oct 21 '15 at 08:31
  • Your first comment was the key issue here. The table was unreponsive while the modal was being dismissed. I assume this isn't something I can change so I've removed the animation and things work fine again :) – mlidal Oct 21 '15 at 08:46
  • if it will work for you then great, but if you'll need animation look for UITransitionDelegate and implement custom anmation that will look like standard but increas speed. – Andrei Malygin Oct 21 '15 at 10:22
  • Thanks for the tip, but my client was satisfied with just removing the animation – mlidal Oct 23 '15 at 07:09

1 Answers1

0

First of all on tap on UITableViewCell, delegate that gets called is didSelectRowAtIndexPath. This gets triggered instantaneously - always!

My guess is you are doing some networking on your main thread on tap on cell and then presenting new screen with that data. This would make UI look delayed and un-responsive. Please double check and ensure all non-UI stuff that need not require main thread goes in a parallel thread.

Abhinav
  • 37,684
  • 43
  • 191
  • 309