I have created a custom subclass of UITextField, CustomTextView.
I created a
private var tapGesture = UITapGestureRecognizer()
in the customTextView class
In the initInView, I have the following code
tapGesture.addTarget(self, action: "tapTextField:") self.addGestureRecognizer(tapGestureRecognizer)
CustomTextView implements UIGestureRecognizerDelgate
- CustomTextView has a private func named tapTextField
Now when I use iOS simulator and click on the text field, the function tapTextField never gets called.
What am I missing here? I saw similar posts but none of them answer my question. I could not comment on those as I don't have reputation yet. So asking as a new question.
PS: Does this have to do with firstResponder being set? This is someone else's code I am working on, so I might have missed something. Let me know what I should look for
Related stack overflow questions: