Invader
Invader

Reputation: 23

Iphone - animations and accelerometer

There is an accelerometer and animation. When the device is shaken animation begins to play, when, during the animation device is shaken again, the animation runs again (this is logical). The question of how to do so would while playing the animation even if the device is shaken the animation does not start anew? Methods & motionEnded motionBegan I do not use.

Upvotes: 0

Views: 279

Answers (1)

danny_23
danny_23

Reputation: 503

It depends on what kind of animation you use in your code. If it's a simple UIImageView animation then you can use (BOOL)isAnimating function of the UIImageView class to prevent the animation sequence to start again if it's running. Hope this helps.

Upvotes: 1

Related Questions