Can't scroll up/down and scroll left/right at the same time on UITableView within a UIScrollView

Hi,


I'm having trouble implementing custom gesture recognition when multiple gestures are occurring at the same time. I want to have control over which gesture gets picked when the user performs a certain action.


I have a couple UITableViews that are within a UIScrollView that has paging enabled, and is setup to let me page left and right so that only one UITableView is visible at a time. A user can't scroll up/down the table view and swipe left/right in the scroll view at the same time, but I would like this to be possible. An example of this would be in the iOS Instagram app on the Activity tab. You can scroll down and then swipe right while the table view is still scrolling.


I was able to get the table view to swipe left/right after stopping scrolling up/down by inheriting from UIScrollView and implementing the shouldRecognizeSimultaneouslyWithGestureRecognizer and shouldBeRequiredToFailByGestureRecognizer methods from UIGestureRecognizerDelegate. My idea was to return true in shouldRecognizeSimultaneouslyWithGestureRecognizer if the user is scrolling up/down the tableView, and then in shouldBeRequiredToFailByGestureRecognizer to fail the table view's up/down gesture. But when you swipe down the table view fast, it will sometimes get stuck because it will think that you are trying to swipe left/right. Any ideas?


Here is a sample project that shows the issue I'm facing: https://github.com/paulsfds/TableViewsInScrollView


Here is my StackOverflow post that has more details: http://stackoverflow.com/questions/31011129/cant-scroll-up-down-and-scroll-left-right-at-the-same-time-on-uitableview-withi


Thanks!

Can't scroll up/down and scroll left/right at the same time on UITableView within a UIScrollView
 
 
Q