iOS Core Animation - Fold a Layer

Viewed 9479

Using Core Animation, I would like to fold a UIView (i.e. it's CALayer) on it's center. i.e. I would set the anchor point as (0.5,0.5) & fold the layer. This image that I created in Photoshop might give the effect I am looking for -

enter image description here

So, what's happening is, the layer is being folded on its center, as the fold is happening a little bit of perspective is applied (the infamous m34!). Initially, the view is parallel in X-Y plane with Z axis looking straight to the user. As the fold is happening, bottom half & top half at the same time move back (with some perspective, to give depth & 3D effect) till the entire layer is (parallel) in X-Z plane. Note that once the layer is parallel in X-Z plane, the user will no longer be able to see the Layer. But that's ok, that's the effect I am looking for. A UIView disappearing by folding on it's center.

How would one go about doing this in iOS? Without using 2 different layers (for bottom & for top)? Any help is much appreciated...

Update: As @miamk points out, this is the same UI effect used in "Our Choice" App or "Flipboard" App.

UPDATE: I have offered bounty on this to get more specific answers. Would love to see -

  1. Code samples.
  2. Advise from people who have done something like this.
  3. Even the way to achieve this in a detailed fashion (algo) is much appreciated.
3 Answers
Related