Hi group,
I am having trouble understanding this bit of code in a modal popup view controller called DetailViewController:
extension DetailViewController: UIGestureRecognizerDelegate {
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
return (touch.view === self.view)
}
let gestureRecognizer = UITapGestureRecognizer(target: self, action: Selector("close"))
gestureRecognizer.cancelsTouchesInView = false gestureRecognizer.delegate = self
view.addGestureRecognizer(gestureRecognizer)
Shouldn’t touch.view === self.view make it so that a tap anywhere in the modal view would dismiss the view controller? How does the app know that the pop-up section being tapped should not dismiss the view?