UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTapGesture:)];

   tapGesture.numberOfTapsRequired = 1; //设置轻拍的次数

设置轻拍时手指的个数

   tapGesture.numberOfTouchesRequired = 2;


  [redView addGestureRecognizer:tapGesture];// 给视图添加手势


   [tapGesture release];



轻拍事件
- (void)handleTapGesture :(UITapGestureRecognizer *)tapGesture
{
    tapGesture.view.backgroundColor = [UIColor random];
}