Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITapGestureRecognizer on UITextField no longer works in IOS 7.1

I have a UITapGestureRecognizer attached to a UITextField to get a "drop down" like effect. When the UITextField is tapped, I present a UIPopover with the content. This worked like a charm pre 7.1 - Now the UITextField just becomes first responder, and the gesturerecognizer is totally ignored. Tried setting delaysTouchedBegan to YES but it didn't help.Any help?

like image 999
HeineSkov Avatar asked Mar 11 '14 13:03

HeineSkov


1 Answers

Why to use UITapGestureRecognizer, better to use UITextFieldDelegate methods

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{

   //Do what you need to do...

}

OR

You can wrap up your textView in a UIView and add the UITapGestureRecognizer on that view.

like image 194
Himanshu Joshi Avatar answered Oct 03 '22 17:10

Himanshu Joshi