UIImageView alpha fade animation issues
I have a UIImageView that I have animated to fade (alpha value) over the period of 60s. After the animation a UIButton displays. In addition by tapping you can force the alpha value of the UIImageView down as to make the animation appear faster. But I am having trouble determining when the alpha value of my UIImageView is below zero - so that I can display the button - even though the animation is still running. Here is my code:
- (void)fadeTheImageView
{
[fadeImageView setAlpha:1.0];
[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context :)];
[UIView setAnimationDuration:10];
[fadeImageView setAlpha:0.0];
[UIView commitAnimations];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if ( fadeImageView.alpha <= 0.0 ) {
[saveButton setHidden:NO];
}
[fadeImageView setAlpha:(fadeImageView.alpha - 0.1)];
}
- (void)yourAnimationHasFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context;
{
[saveButton setHidden:NO];
}
The error is with the if ( fadeImageView.alpha <= 0.0 ) {
incompatible variable types.
I've tried everything.
Any help would be appreciated
iMac, Mac OS X (10.5.6)