views:

118

answers:

1

I'm trying to achieve the camera iris animation from the Apple camera app. It is also found in numerous other apps like RedLaser, Sudoku Grab, so it seems to be fine with Apples rules even thou it's private.

The hidden CATransition animations are dokumented here for example: http://iphonedevwiki.net/index.php/UIViewAnimationState

However I'm not able to get any of the hidden ones to work, public ones work fine thou. Could this be a change of iOS 4? All information I do find on those hidden animations seems a little dated.

Here is my code:

CATransition *animation = [CATransition animation];
animation.delegate = self;
animation.duration = 2.0;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.type = @"cameraIris";

[self.window.layer addAnimation:animation forKey:nil];

Using "reveal" as 'animation.type' works fine with my code.

Has anybody played around with those on iOS 4 yet? Or is the issue totally different? RedLaser uses this effect on iOS 4 (it's not an iOS 4 optimised app thou).

A: 

The animation is found in these other apps because it is Apple's implementation. Accessing the camera API will cause the shutter opening animation to appear. If you want to use this animation for your app in a non-camera api related way, then you will have to roll your own animation.

coneybeare
I do use the camera API with AVCaptureDevice and AVCaptureVideoPreviewLayer etc. These do not however give me the iris shutter animation. Is there a way to activate it when using those APIs? Where I can get the animation is the ImagePicker, but I need the raw video feed from the new iOS 4 APIs.
samy-delux