how to dismiss a view when touch up inside swift
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
{
let touch = touches.first
if touch?.view != self.yourView
{ self.dismiss(animated: true, completion: nil) }
}