i'm trying to animate a UIImageView
to change UIImage
during the animation, but the duration in the method doesn't work, the animation is done immediately, why?
this is the code:
- (IBAction)do_action:(id)sender {
[UIView animateWithDuration:3.0 animations:^{
[self.my_image setImage:[UIImage imageNamed:@"image1"]];
} completion:^(BOOL finished) {
[self.my_image setImage:[UIImage imageNamed:@"image2"]];
}];
}
i have inserted 3 second for the animation duration, but doesn't work, do it immediately , how i can do?