Mode 1:
//Animatewithduration takes 1 seconds to execute the code [UIView animatewithduration:1.0 animations:^{ //Store the animation code that needs to be executedSelf.iconbtn.frame=cgrectmake ( the, -, Max, Max); Self.cover.alpha =0.0; // set the transparency of a control } completion:^(BOOL finished) { //the code inside the block is automatically called when the animation finishes executing.[Self.cover Removefromsuperview]; Self.cover=Nil; }];
Mode 2:
//Execute Animation Code [UIView beginanimations:nil Context:nil]; [UIView setanimationduration: 1.0 ]; [UIView setanimationdelegate:self]; [UIView setanimationdidstopselector: @selector (removercover)]; Self.iconBtn.frame=cgrectmake ( -, -, Max, Max); Self.cover.alpha=0.0; [UIView commitanimations]; }-(void) removercover{[Self.cover Removefromsuperview]; Self.cover=Nil;}
IOS animate code and set control transparency