I have this code in my project:
- (void) fadeImageView {
[UIView animateWithDuration:1.0f
delay:0
options:UIViewAnimationCurveEaseInOut
animations:^{
self.imageView.alpha = 0.0f;
}
completion:^(BOOL finished) {
//make the image view un-tappable.
//if the fade was canceled, set the alpha to 1.0
}];
}
however, there are circumstance where i would like to cancel this operation before the imageview has become invisible. Is there a way to cancel this animation mid animation?
UIViewAnimationOptionCurveEaseInOut
in this case. The value (0) is equivalent toUIViewAnimationCurveEaseInOut
(0<<16) but will fail if you change it to other animation curves. – Sternwheeler