Just getting started with Obj-C and iOS programming. I have some code that loads and imageView into a (HIDDEN: YES) UIView – simply
[bgImageView setImage:[UIImage imageNamed:@"Filename.jpg"];
The code then sets and commits animations on the fgImageView and the bgImageView.
Because some of the images can be large, occasionally the animation from the new bgImage does not render with the new background image in it and instead ‘stalls and displays’. Note that the stall does not happen during setImage. It happens during the second animationCommit later in code. Because animationCommit forces the application to wait until the animation of this ImageView is done.
What I’m looking for is sort of a ‘setImage commit’ on UIImageView,
I’d much rather display a spinner until the image is loaded, then proceed with the animation, however there doesn’t appear to be an isLoaded property for UIImageView class.
Is there a simple way to determine that the UIImageView is done with the setImage call?
There is a method in UIImageView
- (BOOL)isAnimating, so you could potentially use:Would that suffice or is there other animation in progress that would give false responses?