UIActivityIndicatorView: startAnimating() method
The startAnimating() method starts the activity indicator spinning. When hidesWhenStopped is true, it also shows the indicator.
Syntax
startAnimating()Parameters
None.
Return value
None (undefined).
Exceptions
None.
Description
- After the call,
isAnimatingistrue. - When
hidesWhenStoppedistrue, the inheritedisHiddenbecomesfalse. - Calling it while already spinning has no effect.
- The indicator must also be added to a page and have a position before it's visible.
Examples
js
const spinner = new UIActivityIndicatorView();
console.log(spinner.isHidden);
spinner.startAnimating();
console.log(spinner.isAnimating, spinner.isHidden);Result: First prints true; after starting it prints true false. What the rotating indicator looks like on screen is not verified in the simulator.
Corresponding iOS API
-[UIActivityIndicatorView startAnimating].
See also
stopAnimating()- Showing loading and progress: stopping in
finally