trigger willScrollToDateSegmentWith when scrolling programmatically with scrollToSegment#1327
Open
elliotcz97 wants to merge 8 commits intopatchthecode:masterfrom
Open
trigger willScrollToDateSegmentWith when scrolling programmatically with scrollToSegment#1327elliotcz97 wants to merge 8 commits intopatchthecode:masterfrom
elliotcz97 wants to merge 8 commits intopatchthecode:masterfrom
Conversation
When the user scrolled to a segment programmatically with scrollToSegment then the willScrollToDateSegmentWith delegate did not get called. This change fixes this and calls the delegate function at the right time.
|
You need to fix merge conflicts :) |
bystritskiy
reviewed
Dec 1, 2022
| CLANG_ENABLE_MODULES = YES; | ||
| CODE_SIGN_STYLE = Automatic; | ||
| DEFINES_MODULE = YES; | ||
| DEVELOPMENT_TEAM = GBBYECNDQ9; |
| CLANG_ENABLE_MODULES = YES; | ||
| CODE_SIGN_STYLE = Automatic; | ||
| DEFINES_MODULE = YES; | ||
| DEVELOPMENT_TEAM = GBBYECNDQ9; |
| // This was needed for when the user scrolls to next segment which will be the last, | ||
| // then the value is not exact the same as the height of the content, | ||
| // and then the didScrollToSegment delegate got called before the scroll happened, this fixed it. | ||
|
|
|
|
||
| // If we added maybe too much days we check if we are in the range of the calendar | ||
| // if we gone too far we just use the endDate of the Calendar | ||
| if correctedNextDate < endDateCache |
There was a problem hiding this comment.
You can change to:
date = correctedNextDate < endDateCache ? correctedNextDate : endDateCache
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
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.
This PR is a fix and a followup on #1262
My problem was that when I programmatically scrolled the calendar with the function scrollToSegment, then the willScrollToDateSegmentWith delegate did not get called.
I wanted this delegate to work because i wanted to deselect all dates before the scroll did end. I searched for an answer and found the PR #1264 which made the delegate work when the user scrolled with dragging the scrollview. But it did not fix my issue. So i forked his solution and added my fix.
So this PR fixes the willScrollToDateSegmentWith delegate. Now it will get called whenever you scroll via dragging the scrollview, or programmatically using scrollToSegment.