2

i have a code which does some actions after UIImageView.isAnimating is false but funny part is it never goes false its always in YES state.

" isAnimating return is faulty for UIImageView for iPhone "

people from this link see the same fault with IOS4.x so can anyone please suggest any alternative to check whetheror not UIImageview is animating ?

Community
  • 1
  • 1
Yadnesh
  • 1,307
  • 3
  • 17
  • 36

1 Answers1

3

The following suggestions are not ideal, but I guess UIImageView should undergo improvements to become ideal in supporting animations. Anyways, here goes:

  1. You can start a timer with the same interval as the animation length, and act on its expiry. (This solution is also suggested here: How to use isAnimating in an iPhone app)

  2. You can create your animation with an NSTimer that changes the images by itself, completely abandoning UIImageView's animation. There's ready-made code for that here: www.modejong.com/iPhone/ (under PNG Animation). This way you have total control over the animation - you can pause and resume it, call a delegate function on animation end, etc.

And for records sake, a similar question was asked here iPhone : Best way to detect the end of UIImageView image sequence animation, although possible solutions were not iterated.

GL,

Oded.

p.s. Anyone know why I can't post the link above as a simple link? I get a "Sorry, posts can't contain that content." message...

Community
  • 1
  • 1
Oded Ben Dov
  • 9,936
  • 6
  • 38
  • 53