//在系统注册一个动画,告诉系统为当前的动画作准备
//*******************************开始动画*****************************
//参数1:动画的名称作为一个id标志
//参数2:传递参数
[UIView beginAnimations:nil context:nil];
//设置动画执行时间
[UIView setAnimationDuration:3];
//调用方法前必须先设置代理对象
[UIView setAnimationDelegate:self];
//设置在动画执行前调用的方法
[UIView setAnimationWillStartSelector:@selector(animationWillStart)];
[UIView setAnimationDidStopSelector:@selector(animationDidStop)];
//设置动画运动曲线
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//动画重复次数
[UIView setAnimationRepeatCount:10];
//自动执行反向动画
[UIView setAnimationRepeatAutoreverses:YES];
//动画要执行的内容写在begin和commit之间
redView.frame = self.window.bounds;
redView.backgroundColor = [UIColor blueColor];
redView.alpha = 0.5;
//*****************************提交动画,动画才真正开始****************************
[UIView commitAnimations];