-
Notifications
You must be signed in to change notification settings - Fork 453
Improve iOS code to use datasource behaviour from UIPageViewController #189
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
Merged
troZee
merged 16 commits into
callstack:master
from
krystiansliwa:feature/improve-ios-code
Jul 10, 2020
Merged
Improve iOS code to use datasource behaviour from UIPageViewController #189
troZee
merged 16 commits into
callstack:master
from
krystiansliwa:feature/improve-ios-code
Jul 10, 2020
Conversation
This file contains hidden or 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
troZee
reviewed
Jul 5, 2020
@krystiansliwa Good job :D |
This was referenced Jul 6, 2020
… from gesture based callbacks and goTo
b6ec5ae
to
c7f1a14
Compare
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.
Summary
After reviewing iOS code I realized that it can be simplified and optimized a bit.
This PR changes a way of handling controllers in native code.
Previously each view had associated controller that was stored in the memory and each time updated with view if needed. Now controller is created or reused on demand for a particular view.
Also current implementation uses the same method of creating/reusing controller for gesture-based and goTo navigation inside swiper which simplify code.
Some of the previous issues like ViewControllerHierarchyInconsistency should be resolved now.
For storing controllers I decide to use NSHashTable with "weak option" so we are sure that controllers are not retained.
To improve readability I extracted Events classes to corresponding files and moved some methods/properties declarations from .h to .m files.
Test Plan
Just check if it works. There was no API changes, only implementation was changed.
Checklist