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

draggingStartedBlock didn't work when UIView dragged fast enough #20

Open
jeffssss opened this issue Mar 16, 2016 · 1 comment
Open

Comments

@jeffssss
Copy link
Contributor

In Demo, FPViewController.m , I use draggingStartedBlock

- (IBAction)actionSwitch:(UISwitch*)sender {
    [self.draggableViews enumerateObjectsUsingBlock:^(UIView* obj, NSUInteger idx, BOOL *stop) {
        [obj setDraggable:sender.isOn];
        obj.draggingStartedBlock= ^(){
            NSLog(@"dragging!~!~!~!");
        };
    }];
}

when I drag UIView slowly, it works well, but when I drag UIView fast enough, draggingStartedBlock doesn't work.

I think the problem is , when - (void)handlePan:(UIPanGestureRecognizer*)sender is called, sender.state is alreay 'UIGestureRecognizerStateChanged' .
I'm not sure and I wonder whether there are some good solutions.

THANK YOU.

@andreamazz
Copy link
Owner

Maybe when scrolling too fast you are skipping the handle?
See https://github.com/andreamazz/UIView-draggable/blob/master/Source/UIView%2Bdraggable.m#L98-L102

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

No branches or pull requests

2 participants