手勢識別器有:輕拍 ?長按 旋轉(zhuǎn) 捏合 拖拽 清掃 屏幕邊緣拖拽
在使用這些手勢識別器時 先打開用戶交互
imageView.userInteractionEnabled = YES;
創(chuàng)建對象
獲取到輕拍手勢 讓self調(diào)用tapAction:方法(其他手勢的創(chuàng)建也如此)
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selecter(tapAction:)];
創(chuàng)建手勢
[imageView addGestureRecognizer:tap];
內(nèi)存管理
[tap release];
tap.numberOfTapRequired = 2;
手指個數(shù)