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

Changing scope with an UISwipeGestureRecognizer causes currentPage bug #333

Closed
el-angel opened this issue Jun 15, 2016 · 8 comments
Closed
Labels

Comments

@el-angel
Copy link

I've implemented a UISwipeGestureRecognizer on my FSCalendar instance:

swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
swipe.delegate = self;
swipe.numberOfTouchesRequired = 1;
[swipe setDirection:UISwipeGestureRecognizerDirectionDown];   
 [_calendar addGestureRecognizer:swipe];


-(void)handleSwipe:(id)sender {
    if (_calendar.scope == FSCalendarScopeWeek) {
        [_calendar setScope:FSCalendarScopeMonth animated:YES];
    }
}

This works, but it causes the calendar to go like 10 years in the future.

I've also tried to use:
[_calendar setCurrentPage:_calendar.currentPage animated:YES];

after setting the scope, but that didn't work.

Do you have any idea what causes this?

@WenchaoD
Copy link
Owner

Can't just use the scope handle?

@el-angel
Copy link
Author

el-angel commented Jun 16, 2016

I want to be able to just swipe on the calendar and make it go to the Month view. I don't want to use the scope, because of UX choices

@WenchaoD
Copy link
Owner

Have u implemented -calendar:boundingRectWillChange:animated: method?

@el-angel
Copy link
Author

Yes I did!

@NicolasTeam
Copy link

I have a similar problem. When I change from "month view" scope to "week view" scope the calendar changes to previous month automatically. I don't know what is happening.

@el-angel
Copy link
Author

@WenchaoD do you have any idea?

@WenchaoD
Copy link
Owner

calendar.scopeGesture.enabled = YES;

Available in development branch;

@WenchaoD WenchaoD added the Fixed label Jul 14, 2016
@WenchaoD
Copy link
Owner

Merged into master.

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

No branches or pull requests

3 participants