I have a view that sets its hidden when the user taps the main view. I need the view to fade in and out of existence so it looks smoother than just disappearing.
Heres my code so far (It’s inside a touches event):
if (!isShowing) {
isShowing = YES;
myView.hidden = YES;
//Needs to fade out here
}
else {
isShowing = NO;
myView.hidden = NO;
//Needs to fade in here
}
Just wrap your code like this:
or simplify it to this:
You might also want to use
UIView‘ssetAnimationDuration:,setAnimationCurve:, orsetAnimationBeginsFromCurrentState:methods to customize how the view fades in and out.