Skip to content

Changing scope with an UISwipeGestureRecognizer causes currentPage bug #333

@el-angel

Description

@el-angel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions