I have an endlessly looping CABasicAnimation of a repeating image tile in my view:
CABasicAnimation
a = [CABasicAnimation animationWithKeyPath:@\"position\"]; a
I was recognizing the gesture state like so:
// Perform action depending on the state switch gesture.state { case .changed: // Some action case .ended: // Another action // Ignore any other state default: break }
All I needed to do was change the .ended case to .ended, .cancelled.
.ended
.ended, .cancelled