Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (IBAction)panToControlTempo:(UIPanGestureRecognizer *)sender
- {
- CGPoint vel = [sender velocityInView:self.view];
- if (vel.x > 0)
- { // user dragged towards right
- vel.x = 0;
- if (num >= maxNum )
- {
- num = maxNum;
- }else{
- num++;
- }
- }
- else if(vel.x < 0)
- { // user dragged towards left
- vel.x = 0;
- if (num <= minNum)
- {
- num = minNum;
- }else{
- num--;
- }
- }
- else if(vel.y < 0)
- { // user dragged towards up
- vel.y = 0;
- if (num >= maxNum )
- {
- num = maxNum;
- }else{
- num++;
- }
- }
- else if(vel.y > 0)
- { // user dragged towards down
- vel.y = 0;
- if (num <= minNum)
- {
- num = minNum;
- }else{
- num--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement