uias / Pageboy

đź“– A simple, highly informative page view controller
MIT License
1.99k stars 155 forks source link

Push transition also does fade in/fade out of ViewControllers #136

Closed pavelkorolevxyz closed 6 years ago

pavelkorolevxyz commented 6 years ago

When scrolling interaction is enabled on PageboyViewController and user swipes between pages there is no fade in/fade out effect on controller which comes from left/to right. But it's here on scrollToPage. Looks like it's default behavior of CATransition with push type. On previous Pageboy versions there were no custom animations, so this behavior couldn't be reproduced. Is there any way to get same now?

msaps commented 6 years ago

@PavelKorolev hmmm just had a look at the scroll animation when using setViewControllers with animated set to true and also with using the custom Pageboy transition engine and I can't seem to see any difference?

Would you be able to provide a video or something showing what you're seeing?

pavelkorolevxyz commented 6 years ago

Here is Gif You can see when I'm scrolling manually there is no white background blinking over colorful viewcontrollers. But when I'm scrolling using button click and scrollToPage then it's here.

pavelkorolevxyz commented 6 years ago

Any updates on this? Don't want to go back with Pageboy version 1 but currently don't see any solution to workaround Apple's fade animation on push.

msaps commented 6 years ago

@PavelKorolev hey sorry for taking so long!

I've just released Pageboy 2.4 which should resolve the issue!

You can now set PageboyViewController.transition to nil (it is this by default) which will revert to using the default UIPageViewController animation rather than the custom CATransition. You can obviously set a custom transition in the same way as before đź‘Ť

pavelkorolevxyz commented 6 years ago

@msaps Big thanks for that, works fine. As future improvement I can suggest to move this default behavior to Transition.Style enum instead of nil so we can set its duration same as for any other transtion style.

msaps commented 6 years ago

@PavelKorolev this unfortunately isn’t possible as the default animation isn’t configurable at all. Simply a yes or a no, thus why I opted for the nil approach

Sent with GitHawk