I have problem with add a Tap Gesture to my UITextField. Below code:
@IBAction func hanldeTap(recognizer: UITapGestureRecognizer) {
println("works")
}
This action is associated with Tap Gesture Recognizer. In my TextField I have defined gestureRecognizer
in OutletCollections
. In my guess it should works. In described configuration gesture works e.x. for button or custom view.
Can you tell my what could go wrong and how can I fix this?
UITextField has delegate methods
, you might want to consider implementing those. Or just add action event to your textfield.
For example in viewDidLoad
textField.addTarget(self, action:Selector("textDidBeginEditing"), forControlEvents: UIControlEvents.EditingDidBegin)
Then implement this:
func textDidBeginEditing(sender:UITextField) -> Void
{
// handle begin editing event
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With