Search code examples
iosuicollectionviewuicollectionviewcelltransitionviewcontroller

Delay between tap and view controller transition


I've got a collection view cell on which I tap, and which has to navigate to another view controller. The problem is that there is a very slight delay between tap and the navigation, so it does not occur instantly.

The same problem occurs when I tap on "back" button in order to go back to previous VC.

I do not think this is connected with push/pop animation, because the delay exists even if I do it like this: popViewController(animated: false)

So this is something connected with handling touch events, but I have no clue if there is any solution for this. Would be glad to hear any advice on this matter.


Solution

  • As it turned out the reason for my problem was heavy loading of a view controller which I was navigating to, so it took some time for viewDidLoad to finish running, and only after that the new screen starts dragging and becomes visible for user.