- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"touchesBegan");
//test
UITouch *touch = [event allTouches] anyObject];
if ([touch tapCount] == 2) {
NSLog (@"tapcount 2");
[self.textview becomeFirstResponder];
}
else if ([touch tapCount] == 1) {
NSLog (@"tapcount 1");
[self.textview becomeFirstResponder];
[self.view performSelector:@selector(select:)];
}
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesBegan:touches withEvent:event];
NSLog(@"touchesMoved");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"****touchesEnded");
[self.nextResponder touchesEnded: touches withEvent:event];
NSLog(@"****touchesEnded");
[super touchesEnded:touches withEvent:event];
NSLog(@"****touchesEnded");
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesCancelled:touches withEvent:event];
NSLog(@"touchesCancelled");
}
MY QUESTION:
I want to simulate two taps when tapping once on a UITextView
, which is textview in this code. But I do not get NSLog from one and two taps when I tap either once or twice on textview, only outside it. What should I do to make it work?