I\'m setting up the following UIView animateWithDuration:
method, with the intention of setting my animationOn
BOOL elsewhere in the program to can
As per the documentation of View class reference: If you used any of the class methods such as animateWithDuration:delay:options:animations:completion: if the duration is set to negative value or 0, the changes are made without performing animation. so I did something like this to stop the infinite animation:
[UIView animateWithDuration:0.0 animations:^{
button.layer.affineTransform = CGAffineTransformIdentity;
}];
I think this is better than removing all animations from the layer as in the suggested answer. Note that this is applicable for all other class animation methods in the UIView class.