당신은 친구를 이동합니다.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch =[[[event allTouches] allObjects] lastObject];
//NSLog(@"touchesBegan ...");
switch ([touch tapCount])
{
case 1:
[self performSelector:@selector(oneTap) withObject:nil afterDelay:.5];
break;
case 2:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(oneTap) object:nil];
[self performSelector:@selector(twoTaps) withObject:nil afterDelay:.5];
break;
case 3:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(twoTaps) object:nil];
[self performSelector:@selector(threeTaps) withObject:nil afterDelay:.5];
break;
default:
break;
}
};
- (IBAction)oneTap
{
NSLog(@"oneTap ...");
}
- (IBAction)twoTaps
{
NSLog(@"twoTaps ...");
}
- (IBAction)threeTaps
{
NSLog(@"threeTaps ...");
}