Skip to content
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

Error : Fix limited scrolling range when dragging #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aron1127
Copy link

Hi @zjfjack

I've found this error since long ago.
I have solved this problem and have been using it.
Upload the Pull Request to share with everyone.

Error situation :

  1. Stop in the middle when you drag.
  2. The calendar automatically aligns with the screen.
  3. But if you start dragging again Before views are automatically sorted,
  4. You will be able to drag beyond the limited range.
    ex) Set limited range to September 10, 2019.
    If you drag quickly as described, you can drag before September 10.
  • I am not good at English, so I will take a video if you can't understand it

2 Causes :
First, change the scrollDirection variable to nil unconditionally in the scrollViewDidEndDecelating() function.
Second, the loadPage() function is called very often.

Change point :
Added checkDragRangesInHorizontalScroll() function to JZBaseWeekView.swift.
Use the function when setting the scrollDirection variable in the scrollViewDidEndDecelating() function.
Also invokes the function before using loadPageSectionScroll().
The checkDragRangesInHorizontalScroll() function compares the difference between the date on the screen that I am viewing and the date that is limited.

I couldn't analyze all the sources.
So I don't think this is a good way.
But it works! (CAUTION: Not many tests try.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant