I learned how to create smooth transitions between views with the ‘UIViewAnimationTransitionCurlUp’ as shown below.
Is there a similar way to transition between images that are being switched within a single UIImageView thats in a View?
[UIView beginAnimations:@"Animation" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.window cache:YES];
[view1 removeFromSuperview];
[window addSubview:view2];
[UIView commitAnimations];
This is the code I am using to switch images currently:
[lblSwipe setText:@"Left Swiped."];
currentImageIndex++;
if (currentImageIndex == [imagesArray count]) {
currentImageIndex = 0;
}
[imageView setImage:[UIImage imageNamed:[imagesArray objectAtIndex:currentImageIndex]]];
}
How would I adapt the code for my particular situation?
We talked about this in the comments, but I’ll post an official answer:
You can use the same code you are using to animate transitions between
UIViewobjects to animate betweenUIImageViewobjects sinceUIImageViewis a subclass ofUIView.