stopAnimating
StopAnimating is a method used in iOS user interface programming to halt a repeating animation on a view. It is most commonly invoked on UIActivityIndicatorView to stop the spinning indicator, or on UIImageView when the view is configured with an array of images for animation. In Swift, the method is defined as func stopAnimating(), and in Objective-C as - (void)stopAnimating. Paired with startAnimating() and the isAnimating property, it enables simple start/stop control of animations.
In UIActivityIndicatorView, calling stopAnimating stops the spinner animation and sets the isAnimating property to false; if
In UIImageView, if the image view has animationImages set, stopAnimating halts the animation sequence, and the
Best practices: perform on the main thread, avoid blocking user input during start/stop; pair with appropriate