I\'m new to IOS programming, I\'m displaying a view when a button is clicked, using the following code inside the button method.
@IBAction func moreButton(_
In touch began you should write like
override func touchesBegan(_ touches: Set, withEvent event: UIEvent) { var touch: UITouch? = touches.first //location is relative to the current view // do something with the touched point if touch?.view != yourView { yourView.isHidden = true } }