読者です 読者をやめる 読者になる 読者になる

at kaneshin

Free space for me.

UITapGestureRecognizer

// single tap
UITapGestureRecognizer* singleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTapGesture:)];
[self.view addGestureRecognizer:singleTapGesture];

// double tap
UITapGestureRecognizer* doubleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTapGesture:)];
[doubleTapGesture setNumberOfTapsRequired:2];
[self.view addGestureRecognizer:doubleTapGesture];

- (void)handleSingleTapGesture:(UITapGestureRecognizer*)sender
{
    NSLog(@"single tap");
}

- (void) handleDoubleTapGesture:(UITapGestureRecognizer*)sender
{
    NSLog(@"double tap");
}