Advertisement
Guest User

Untitled

a guest
Aug 24th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. - (IBAction)panToControlTempo:(UIPanGestureRecognizer *)sender
  2. {
  3. CGPoint vel = [sender velocityInView:self.view];
  4. if (vel.x > 0)
  5. { // user dragged towards right
  6. vel.x = 0;
  7. if (num >= maxNum )
  8. {
  9. num = maxNum;
  10. }else{
  11. num++;
  12. }
  13. }
  14. else if(vel.x < 0)
  15. { // user dragged towards left
  16. vel.x = 0;
  17. if (num <= minNum)
  18. {
  19. num = minNum;
  20. }else{
  21. num--;
  22. }
  23. }
  24. else if(vel.y < 0)
  25. { // user dragged towards up
  26. vel.y = 0;
  27. if (num >= maxNum )
  28. {
  29. num = maxNum;
  30. }else{
  31. num++;
  32. }
  33. }
  34. else if(vel.y > 0)
  35. { // user dragged towards down
  36. vel.y = 0;
  37. if (num <= minNum)
  38. {
  39. num = minNum;
  40. }else{
  41. num--;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement