Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CGPoint velocity = [recognizer velocityInView:self.cardView];
- if (fabs(velocity.y) > fabs(velocity.x)) {
- //vertical motion
- }
- else if (fabs(velocity.x) > fabs(velocity.y)) {
- //horizontal motion
- CGPoint translation = [recognizer translationInView:self.cardView];
- recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,
- recognizer.view.center.y);
- [recognizer setTranslation:CGPointMake(0, 0) inView:self.cardView];
- }
Add Comment
Please, Sign In to add comment