I have a scrollable, non-ediable UITextView. I want to add a gesture recognizer to it so when double tap it, a tool bar will show, double tap it again, tool bar will hide.
I have disabled the selection function of the text view by subclassing it and override canBecomeFirstResponder to return NO.
It seems ok when i just simply add the tap recognizer to it.
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showOrHideToolbars)];
tapRecognizer.numberOfTapsRequired = 2;
tapRecognizer.numberOfTouchesRequired = 1;
[textView addGestureRecognizer:tapRecognizer];
It works good, excepts if i tap and hold on the text view, after that, the recognizer will not receive any action any more.
This means, if I tap and hold on the text view (i guess text view goes into a selection mode even i disable the selection function), no more double tap can be detected now.
I tried to use single tap then problem is gone but i do need to use double tap.
I also tried to override touch event handler methods, but no use.