I have a view that I am showing. The view appears on the same screen with UITableView. I want to dismiss the view when anywhere on the screen is touched, but I don’t want to prevent that touch from getting to its target. For instance, if the user goes to scroll the table view or select a cell or anything – I want to know so I can dismiss the view but I want whatever the user was touching to react as it normally would. Any help would be great.
Share
Implement
hitTest:withEvent:method on that UIView’s class. Check the location of the touch. If your view’s frame does not contain it – dismiss the view.