I set up the recognizer like this:
@IBAction func changeSeq(_ recognizer: UISwipeGestureRecognizer) {
if (recognizer.direction == UISwipeGestureRecognizerDirection.left)
{
print ("nice")
}
}
I need it disabled when the start button is pressed and enabled again when the pause is triggered. I don't want to disable all user interaction. How do I handle the swipe specifically?
In your start button
IBAction
code, set the gesture recognizer'senabled
property to false, and in the pause button'sIBAction
, setenabled = true
.That's cleaner than setting the delegate to nil.