UIActivityIndicatorView: stopAnimating() method
The stopAnimating() method stops the activity indicator. When hidesWhenStopped is true, it also hides the indicator.
Syntax
stopAnimating()Parameters
None.
Return value
None (undefined).
Exceptions
None.
Description
- After the call,
isAnimatingisfalse. - When
hidesWhenStoppedistrue, the inheritedisHiddenbecomestrue; when it'sfalse, the indicator stays on screen and stops rotating. - Calling it while not spinning has no effect.
Examples
js
const spinner = new UIActivityIndicatorView();
spinner.startAnimating();
spinner.stopAnimating();
console.log(spinner.isAnimating, spinner.isHidden);Result: Prints false true.
Corresponding iOS API
-[UIActivityIndicatorView stopAnimating].