stefanceriu / SCPageViewController

Just like UIPageViewController but better.. :)
MIT License
352 stars 70 forks source link

Can slide multi page in card mode even if continuousNavigationEnable set to true. #21

Closed twotreeszf closed 8 years ago

twotreeszf commented 8 years ago

When the page view controller works on card view mode, you can flip multipage at one time, if long distance and quickly slide even if continuousNavigationEnable seted to true.

stefanceriu commented 8 years ago

Okay, I think I understood where the problem lies.

There's this property in the SCPageLayouterProtocol called navigationConstraintType which defines when the page view controller should enforce page bounds while navigating and it can take one or more of the following 3 values: SCPageLayouterNavigationContraintTypeNone, SCPageLayouterNavigationContraintTypeForward and SCPageLayouterNavigationContraintTypeReverse

The default for the SCCardsPageLayouter used to be set to SCPageLayouterNavigationContraintTypeNone meaning that the PageViewController wouldn't enforce any of the pages bounds, ever.

continuousNavigationEnabled on the other hand, is a page view controller property that, when set to true, completely disables the navigational constraints. It would behave exactly the same as setting the layouter's navigation constraint to SCPageLayouterNavigationContraintTypeNone

I do hope all of this makes sense. I will enable all constraints by default on the cards page layouter and that should fix your problem.

stefanceriu commented 8 years ago

Available in v2.0.4 here https://github.com/stefanceriu/SCPageViewController/releases/tag/v2.0.4

twotreeszf commented 8 years ago

Thanks, More perfect now.