代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. self.title=@"拍照动画"; }
//点击任何处,弹出动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CATransition *shutterAnimation = [CATransition animation];
shutterAnimation.delegate = self;
shutterAnimation.duration = 0.5f;
shutterAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
shutterAnimation.type = @"cameraIris";
shutterAnimation.subtype = @"cameraIris";
[self.view.layer addAnimation:shutterAnimation forKey:@"cameraIris"]; }