-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Prevent from scrolling "overflow". #1343
base: master
Are you sure you want to change the base?
Conversation
Prevent from scrolling "overflow". This happens when we perform (1) Scroll down to switch from week view to month view. (2) Without releasing gesture, reverse scroll direction to up, to switch back week view. (3) Once we hit week view, and continue the scroll-up action, we can observe scrolling "overflow" behavior. or (1) Scroll up to switch from month view to week view. (2) Without releasing gesture, reverse scroll direction to down, to switch back month view. (3) Once we hit month view, and continue the scroll-down action, we can observe scrolling "overflow" behavior.
CGFloat y = [panGesture translationInView:panGesture.view].y; | ||
|
||
// | ||
// Prevent from scrolling "overflow". This happens when we perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice explanation 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi WenchaoD,
Thank you for looking at this issues.
The submitted patch, is intent to resolve issue "during gesture", where it causes weird UI outcome.
However, I notice there is another issue "after releasing gesture".
Please note that, the issue "after releasing gesture" already occur, even before this patch.
If you look at the animation after fix (From week view, to month view, then to week view again)
Even though there is no weird UI outcome "during gesture", but the logic which determines the final state after "after releasing gesture" is incorrect.
For the above use case, the final state should be week view, "after releasing gesture". Somehow, the logic in scopeTransitionDidEnd
incorrectly make the final state as month view.
I am currently studying and testing the logic of the following function
- (void)scopeTransitionDidEnd:(UIPanGestureRecognizer *)panGesture |
If you agree, I would like to submit another code patch, to fix on scopeTransitionDidEnd
.
Thank you very much for the your wonderful library. I just start learning on your library to integrate into my project, and hopefully can provide meaningful contribution soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with the patch on scopeTransitionDidEnd
👍
Prevent from scrolling "overflow". This happens when we perform
(1) Scroll down to switch from week view to month view.
(2) Without releasing gesture, reverse scroll direction to up, to switch back week view.
(3) Once we hit week view, and continue the scroll-up action, we can observe scrolling "overflow" behavior.
or
(1) Scroll up to switch from month view to week view.
(2) Without releasing gesture, reverse scroll direction to down, to switch back month view.
(3) Once we hit month view, and continue the scroll-down action, we can observe scrolling "overflow" behavior.
Before the fix, here's the demo of unwanted behavior.
Before fix
(From week view to month view, then to week view again)
(From month view to week view, then to month view again)
After the fix
(From week view to month view, then to week view again)
(From month view to week view, then to month view again)