hello all
i am trying fade a view in and out... which is simple in concept... but for some reason my code fires instantaneously rather than taken the specified amount of time to animate the transition. here is my code
Code:
- (void) fadeIn {
[[self myView] setAlpha:0.0];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(fadeOut)];
[[self myView] setAlpha:0.8];
[UIView commitAnimations];
}
- (void) fadeOut {
NSLog(@"fadeOut called"); // just a marker so i can see if this is being called after 2 seconds
}
my problem is when fadeIn is called, the alpha is immediately set to 0.8 and fadeOut is called (i can see the nslog statement pop up as soon as i see the view)
any idea's as to why this is happening?