@IBAction func swipeHandler(_ gestureRecognizer : UISwipeGestureRecognizer) { if gestureRecognizer.state == .ended { // Perform action. } }