开发者

Hidden CATransition animations on iOS 4 (camera iris animation)

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).


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜