SWIFT 3 Example
override func viewDidLoad() {
self.backgroundImageView.addGestureRecognizer(
UITapGestureRecognizer.init(target: self, action:#selector(didTapImageview(_:)))
)
self.backgroundImageView.isUserInteractionEnabled = true
}
func didTapImageview(_ sender: Any) {
// do something
}
No gesture recongnizer delegates or other implementations where necessary.