UIView随手势拖动

- (void) handleSwipe:(UIPanGestureRecognizer*) recognizer

{

    

    CGPoint translation = [recognizer translationInView:self.view];

    recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,

                                         recognizer.view.center.y + translation.y);

    [recognizer setTranslation:CGPointZero inView:self.view];

}

你可能感兴趣的:(UIView随手势拖动)