【代码笔记】iOS-拍照动画

时间:2022-10-21 21:38:05

代码:

【代码笔记】iOS-拍照动画
- (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"]; }
【代码笔记】iOS-拍照动画