2
votes

I have 3 viewcontrollers inside a UIScrollView that page horizontally. each viewcontroller has a tableview within it.

I can swipe between the 3 viewcontrollers easily when the active table is still (not scrolling) - but when i try to page left or right when the tableview is moving it seems to ignore the touch and gets stuck. I have to stop the tableview with a touch before paging (almost as if the tableview is trying to receive the horizontal gesture)

how can I make my scrollview always react to a horizontal paging

here is a visual of my setup:

tell me if you need any more info

enter image description here

1
What you want to implement is called Cross-Directional Scrolling, here is a good solution in a similar question: stackoverflow.com/a/21211034/602257 - Malloc

1 Answers

1
votes

There are multiple ways to get around this.

One way is that you could manage the horizontal scrolling yourself with UIGestureRecognizer. So if there is a left swipe then scroll horizontally to the left and vice versa for right swipe. That way if a UITableViewController is vertically scrolling at the time of the horizontal swipe, it won't have to wait until it is stopped to detect it.