-(void) viewdidload {[Super viewdidload]; Additional setup after loading the view, typically from a nib. UIView UIView *view=[[uiview Alloc]initwithframe:cgrectmake (10, 100, 100, 200)]; View.backgroundcolor=[uicolor Redcolor]; [Self.view Addsubview:view]; Fade out//[self Fadeout:view]; Fade//[self Fadein:view]; }//fade-(void) FadeOut: (UIView *) view{cgcontextref context = Uigraphicsgetcurrentcontext (); [UIView Beginanimations:nil Context:context]; [UIView Setanimationcurve:uiviewanimationcurveeaseinout]; [UIView setanimationduration:0.3]; [View setalpha:0.0f]; [UIView commitanimations];} Fade in-(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];}
Fade Fade In