I am developing an application where I have multiple controls on view but I want to enable them when user double tap the view
You can take the example of double click b
You need to add an UITapGestureRecognizer
to the view which you want to be tapped.
Like this:
- (void)viewDidLoad {
[super viewDidLoad];
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
tapGesture.numberOfTapsRequired = 2;
[self.view addGestureRecognizer:tapGesture];
[tapGesture release];
}
- (void)handleTapGesture:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateRecognized) {
// handling code
}
}
Add a UITapGestureRecognizer
to the view, with numberOfTapsRequired = 2
.