Add panBoundsPoint property to TransitionGestureHandler #15
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.
I was looking for a way to configure an end point to the pan gesture so the interactive transition would look smoother.
Imagine that you have a
targetView
that its position starts at the bottom of the screen with a pan gesture handler configured withtop
direction and ends at the center of the screen when transitioning to the nextviewController
. In current implementation the user would need to pan until the top of the screen and thetargetView
would look misplaced compared to the user's finger.This PR fixes that by introducing a new
CGPoint
property toTransitionGestureHandler
calledpanBoundsPoint
.When
panBoundsPoint
is set thepercentComplete
will take into account thepanBoundsPoint
as the endPoint of the transition instead of thetargetVC.view.bounds
.To be honest I'm happy with the results but it seems that there's a best way to handle this.
Anyway it was the solution I came up with now.
Let me know what you think.