Overlapping UIView animation canceling the first completion block
<p>I have two buttons to move views. When I press the first button it will move a view and the other will move it back.</p>

<p>The first animation has a completion block, but I want to prevent this block from executing when the user moves the view back before the completion is done.</p>

<p>I have tried using solutions given to other questions similar to this but it doesn't seem to stop the execution of the first completion block.</p>

<pre><code>@IBOutlet func moveView(sender: AnyObject) {
    UIView.animateWithDuration(0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: .AllowUserInteraction, animations: { /* animation */ }) { _ in /* completion */ }
}

@IBOutlet func moveBack(sender: AnyObject) {
    UIView.animateWithDuration(0.0, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: .BeginFromCurrentState, animations: { /* animation */ }) { _ in /* completion */ }
}
</code></pre>

<p>I also tried removing all the animations and the completion parameter will be false but the animation will just jump to the end and animate from there.</p>

<p>Any ideas is very much appreciated.</p>