I have a view that looks like this:
When the user tries to enter information the keyboard covers the UITextViews
I thought trying to detect a tap on the UITextView
using a UIGestureRecognizer
that I added to the UITextView
, and then change the constraints according to the view which was tapped.
When I tap it the app crashes.
This is the code I used to detect a tap on the UITextViews
-
//in viewDidLoad
let tap = UITapGestureRecognizer(target: self.textYoutube, action: "handleTap")
self.textYoutube.addGestureRecognizer(tap)
func handleTap(tap: UITapGestureRecognizer) {
if (tap.state == UIGestureRecognizerState.Ended) {
println("[handleTap] Tap ended")
}
}
Is there something wrong with my code? Is there a better way of moving the UITextViews
?