Fade in and fade in
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // UIView * view = [[UIView alloc] initWithFrame: CGRectMake (10,100,100,200)]; view. backgroundColor = [UIColor redColor]; [self. view addSubview: view]; // Fade Out // [self fadeOut: view]; // fade in // [self fadeIn: view];} // fade out-(void) fadeOut :( UIView *) view {CGContextRef context = values (); [UIView beginAnimations: nil context: context]; [UIView setAnimationCurve: values]; [UIView setAnimationDuration: 0.3]; [view setAlpha: 0.0f]; [UIView commitAnimations];} // void-fadeIn :( UIView *) view {CGContextRef context = UIGraphicsGetCurrentContext (); [UIView beginAnimations: nil context: context]; [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration: 0.3]; [view setAlpha: 1.0f]; [UIView commitAnimations];}