你的位置:首页 > 操作系统

[操作系统]【代码笔记】拍照动画


代码:

复制代码
- (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"];}
复制代码