Closed theluxury closed 9 years ago
I've never tried, but it should be possible. That's default pageviewcontroller behavior that you're trying to get rid of. What you would need to do is dig up the UIScrollView inside the pageviewcontroller and tell it not to move when you're swiping in a certain direction on a certain page.
I already dug up the scrollView (I think the property is just called scrollView), and you'll have to mess with scrollview delegate functions. I'm sure people have done this before, i would look it up first. it might actually be as easy as saying something like scrollView.springsAtEdges = NO or something like that (that's not a real property, just an example)
Hey Richard, thanks for the thoughtful response! And thanks a lot for making this library, it's great! :)
I first looked at http://stackoverflow.com/questions/5370428/uiscrollview-disable-scrolling-in-just-one-direction, but that solution was buggy. However, I found that for whatever reason setting .bounces = NO; on one end disabled the animation on the other end too. So I eventually wound up with this solution
if (self.currentPageIndex == 0 || self.currentPageIndex == 2)
scrollView.bounces = NO;
else
scrollView.bounces = YES;
in -(void)scrollViewDidScroll:(UIScrollView *)scrollView, which works perfectly for what I want it to do. 0 and 2 in this instance are my edge views.
Right now if you swipe right from the initial controller, it starts the animation even though there's nothing to swipe to. Is there a way to disable this animation?