I don't see any problem with your animation code, except that within the animation block you are referencing to the ZombieView
that is connected to the one via IBOutlet
, not the one you declare directly above the animation block.
And, you are using the transform of the UIImageView
(self.ZombieView
) connected through the IBOutlet
to create a translate that you apply to the transform of the UIImageView
(ZombieView
) that is declared directly above the animation block.
Perhaps that is the reason.
Other than that, your animation should work.
Addendum:
I just remembered that using transforms when autolayout
is enabled could produce unexpected results. So, in your case, if self.ZombieView
is created on storyboard with that turned on and with you using that transform and apply it to the ZombieView
transform, what you are experiencing can be explained.
So: within the animation block, change self.ZombieView.transform
to ZombieView.transform
and it should do as you expect.
Hope this helps.