Search code examples
iosswiftuitableviewuipageviewcontroller

cross scrolling: tableview inside UIpageViewcontroller does not behave properly


In my app, I have a UIPageViewcontroller. Inside the UIPageViewcontroller, I have a Viewcontroller with a table inside of it.

The problem I am having is, when I am scrolling down the table, I can't scroll between pages. unless I lift my finger up. (this also has to make sure that table stops scrolling completely)

I was hoping there would be a more natural way of doing this.enter image description here

Is there a way to swipe between pages even when your scrolling down the table, without have to lift up your finger


Solution

  • I just tried Instagram, they have same UI as you are trying to achieve. When I scrolled through Insta posts, I could not Swipe between View Controllers until table scroll stops.

    1 option you can do is to reduce the speed of table scroll using following code:

    self.tableview.scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
    

    This code will allow table to stop quickly and hence user can swipe.

    Hence, I would say, it is not possible to swipe between view controller unless table scrolling is stopped.