轻拍(tap)
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
//设置轻拍次数(默认1)(按2次好使)
tap.numberOfTapsRequired = 2;
//设置轻拍的手指个数(默认1)
// tap.numberOfTouchesRequired = 2;
轻扫(swipe)
//默认从左往右
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipe:)];
[imageView addGestureRecognizer:swipe];
//要么上下一起 要么左右一起(下面的写法只能执行左右)
swipe.direction = UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionLeft | UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionUp;
//设置轻扫手指个数
swipe.numberOfTouchesRequired = 2;
捏合(pinch)
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)];
[imageView addGestureRecognizer:pinch];
旋转 (Rotation)
UIRotationGestureRecognizer *rotation = [[UIRotationGestureRecognizer alloc]initWithTarget:self action:@selector(rotation:)];
[imageView addGestureRecognizer:rotation];
平移(Pan)
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[imageView addGestureRecognizer:pan];
长按(LongPress)
UILongPressGestureRecognizer *longpress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longpress:)];
[imageView addGestureRecognizer:longpress];
//长按时间
longpress.minimumPressDuration = 1;