Hi, i need to often include the below codes for animation purpose throughout my program. For efficiency purpose, i would like to make this as a class that i can often refer to.
Code:
UIImageView *gameOver;
gameOver=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 477)];
gameOver.image=[UIImage imageNamed:@"gameover.png"];
gameOver.alpha=0.0;
[self.view addSubview:gameOver];
[UIView beginAnimations:nil context:gameOver];
[UIView setAnimationDuration:2.0];
gameOver.alpha=1.0;
[UIView commitAnimations];
[gameOver release];
How can i make this as a common class?
i tried creating a Transition class, but not sure if it is right. The codes are as follows:
Code:
+(void)beginTransition:(UIImageView *)theImageView:(struct CGRectMake *)dimension:(NSString *)imageFile:(float)startAlpha:(float)endAlpha;
Hope to get some help. Thanks.