Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

elliotcz97
Copy link

@elliotcz97 elliotcz97 commented May 30, 2021

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.

@bystritskiy
Copy link

You need to fix merge conflicts :)

CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = GBBYECNDQ9;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need

CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = GBBYECNDQ9;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need

// 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line


// 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change to:

date = correctedNextDate < endDateCache ? correctedNextDate : endDateCache

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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.