Shutter animation AVFoundation iphone

camera, ios

Solution

Well, I found this somewhere:

     CATransition *shutterAnimation = [CATransition animation];
     [shutterAnimation setDelegate:self];
     [shutterAnimation setDuration:0.6];

     shutterAnimation.timingFunction = UIViewAnimationCurveEaseInOut;
     [shutterAnimation setType:@"cameraIris"];
     [shutterAnimation setValue:@"cameraIris" forKey:@"cameraIris"];
     CALayer *cameraShutter = [[CALayer alloc]init];
     [cameraShutter setBounds:CGRectMake(0.0, 0.0, 320.0, 425.0)];
     [self.layer addSublayer:cameraShutter];
     [self.layer addAnimation:shutterAnimation forKey:@"cameraIris"];

It's the default iPhone camera shutter animation.

Problem

I am trying to replicate iPhone Camera app default shutter animation. Maybe anyone has tried doing that and have some hints to share?

Original source