Question

Want to create a loading view that matches the speed of the UIActivityIndicatorView depending on the network type.

Is it accessible via the SDK or at the very least disclosed?

Was it helpful?

Solution

How fast it spins? Short answer is no :(

OTHER TIPS

Not with a simple property or something like that. You do have a few options though:

  1. Create it yourself. The images are available when you use iOS Artwork Extractor, so you could give it the same look. Perhaps a little tedious. Maybe you could even subclass it.

  2. Do some hackery with the current startAnimating and stopAnimating methods. Basically start and stop it for a period of time using a timer. This may not look great though as NSTimer doesn't always give you the precision you'd want in this case.

  3. Since UIActivityIndicatorView inherits from UIView, you can access its layer property. This is a CALayer, which has instance methods like animationKeys and animationForKey. This is probably the best way to go about it, though it's not very future-proof since you're modifying the internals which can always change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top