I added a UITapGestureRecognizer
to my main Content View
in my ViewController to dismiss my keyboard when the content view is tapped.
The problem is that I have a UICollectionView
inside my content view, and setting the UITapGestureRecognizer
intercepts the taps of my UICollectionView
.
How do I allow my UICollectionView
's taps to go through so that the didSelectItemAtIndexPath
method will fire again?
func setupGestureRecognizer() {
let dismissKeyboardTap = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
contentView.addGestureRecognizer(dismissKeyboardTap)
}
func dismissKeyboard() {
contentView.endEditing(true)
}