-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom page view controller #468
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The implementation is split into two classes, PageViewController and PageViewManager. PageViewManager is responsible for all the logic related to adding/removing view controllers and calling the correct appearance transitions, while PageViewController is responsible for updating the UIScrollView.
Adds another flag to the layoutViews method so we can opt-out of accounting for the current content offset when rotating.
Make sure viewWillAppear, viewDidAppear, viewWillDisappear and viewDidDisappear is forwarded to the selected view controller and include the correct animated flag.
Moves the PageViewManager configuration to the initializers to ensure that we handle the selectViewController method if it's called before viewDidLoad has been triggered.
Ideally we would keep these private, but the current implementation exposes them so it better not to break existing apps.
rechsteiner
changed the title
WIP: Custom page view controller
Custom page view controller
Apr 22, 2020
Closed
This was referenced Apr 24, 2020
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tracks the process of creating a custom
UIPageViewController
class. The new implementation fixes a couple of issues that are present in theEMPageViewController
implementation we're using today.Appearance transitions
There's been a few issues with appearance transitions getting called out of order (#426, #373), but the current implementation makes it very hard to unit-tests that everything is working correctly. Another problem is that the appearance transitions are called a lot of times when flicking fast to the next page. This happens because the scroll view starts bouncing back and forth between the upcoming and previous view controller before landing on the new one. Here's a comparison of how the different implementations behave (using the Size Delegate example):
UIPageViewController
EMPageViewController
The new implementation follows the same behaviour as
UIPageViewController
.Todo
Spacing between pages