I have an imageView background which changes on swipes. Currently it changes instantly, but can I use a fade effect so that the next image fades into view?
I have found some results when searching, but mostly in Java
I have an imageView background which changes on swipes. Currently it changes instantly, but can I use a fade effect so that the next image fades into view?
I have found some results when searching, but mostly in Java
I am guessing you are using a swipe gesture on your imageView to change the image when the swipe happens.
So in the target method of your swipe gesture where you are currently changing the image, Set an animation block to do your animation, something like this
[UIView animateWithDuration:1.0 animations:^{
imageview.alpha = 0.0;
} completion:^(BOOL finished) {
imageview.image = newImage;
[UIView animateWithDuration:1.0 animations:^{
imageview.alpha = 1.0;
}];
}];
This is the a simpler way to achieve this , hope this helps. Cheers !