???????????????????????????
?????????UIGestureRecognizerStateBegan
???????UIGestureRecognizerStateChanged
??????????UIGestureRecognizerStateEnded
?????????UIGestureRecognizerStateCancelled
????????UIGestureRecognizerStateFailed
????3.????????SwipeGestureRecognizer??
?????????????????????????????????????????? ?????????????????????????????????????????????????????
?????????????????????????????????????£?
????1     //??????????
????2     UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)];
????3     //????????????
????4     swipeGesture.direction = UISwipeGestureRecognizerDirectionRight; //???????
????5     [self.view addGestureRecognizer:swipeGesture];
????6
????7     //??????????
????8     UISwipeGestureRecognizer *swipeGestureLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)];
????9     //????????????
????10     swipeGestureLeft.direction = UISwipeGestureRecognizerDirectionLeft; //???????
????11     [self.view addGestureRecognizer:swipeGestureLeft];
??????????????£?
1 //??????????????
2 -(void)swipeGesture:(id)sender
3 {
4     UISwipeGestureRecognizer *swipe = sender;
5     if (swipe.direction == UISwipeGestureRecognizerDirectionLeft)
6     {
7         //???????????????
8     }
9     if (swipe.direction == UISwipeGestureRecognizerDirectionRight)
10     {
11         //???????????????
12     }
13 }
14
????4.????????PinchGestureRecognizer??
???????????????
????1     //??????????
????2     UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGesture:)];
????3     [self.view addGestureRecognizer:pinchGesture];
???????????????????????????????С??????
1 ////??????????????
2 -(void) pinchGesture:(id)sender
3 {
4      UIPinchGestureRecognizer *gesture = sender;
5
6     //???????
7     if (gesture.state == UIGestureRecognizerStateChanged)
8     {
9         //?????????scale???????????????
10         _imageView.transform = CGAffineTransformMakeScale(gesture.scale?? gesture.scale);
11     }
12
13     //????????
14     if(gesture.state==UIGestureRecognizerStateEnded)
15     {
16         [UIView animateWithDuration:0.5 animations:^{
17             _imageView.transform = CGAffineTransformIdentity;//???????α?
18         }];
19     }
20 }
????5.????????PanGestureRecognizer??
????????????????
????1     //??????????
????2     UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
????3     [self.view addGestureRecognizer:panGesture];
????????????????????????translationInView???????????TouchesMoved?????????
????1 //???????
????2 -(void) panGesture:(id)sender
????3 {
????4     UIPanGestureRecognizer *panGesture = sender;
????5
????6     CGPoint movePoint = [panGesture translationInView:self.view];
????7
????8     //?????????????
????9 }