How fast it spins? Short answer is no :(
Is the relative speed of the UIActivityIndicatorView accessible?
-
21-06-2022 - |
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?
Solution
OTHER TIPS
Not with a simple property or something like that. You do have a few options though:
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.
Do some hackery with the current
startAnimating
andstopAnimating
methods. Basically start and stop it for a period of time using a timer. This may not look great though asNSTimer
doesn't always give you the precision you'd want in this case.Since
UIActivityIndicatorView
inherits fromUIView
, you can access itslayer
property. This is aCALayer
, which has instance methods likeanimationKeys
andanimationForKey
. 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.