Only disable user interaction when animating (fixes Issue #242) #243
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.
What is this PR for?
This PR fixes #242.
What was the source of the problem?
When
moveToViewController(at: Int, animated: Bool)
ormoveTo(viewController: UIViewController, animated: Bool)
was called, user interaction was disabled to prevent the user from interacting with the UI in the middle of a transition. Then, inscrollViewDidEndScrollingAnimation(_:UIScrollView)
, user interaction would be enabled again. However, when passingfalse
for theanimated
parameter, this method does not get called and user interaction won't be enabled again.What's the fix for the problem?
The fix is simple. We don't need to disable user interaction when the transition is not animated since the
contentOffset
of the scroll view gets set immediately. I tested it and can I can confirm that it works now.How to test these changes
In the corresponding issue, you will find a link to an example project which demonstrates the issue. Run it and tap the bar button item to confirm the issue. Then open the
Cartfile
and specify this branch:Run
, build the project and see the issue fixed.
@mtnbarreto @mats-claassen please review and merge 🙂