views:

1204

answers:

5

The iPhone has a private list of effects that Apple uses, such as "genieEffect" and "slurpEffect". I'm wondering how one would go about implementing the slurp effect (this is when you trash a mail message or a note).

I understand how to use Core Animation, but I'm not sure exactly what parts of it they're using to get that animation.

+1  A: 

This post talks about using the private API for the effect: link text

Marco Mustapic
I understand how to get the effect using the private API, but that's not what I'm after, as I would prefer my app not to be rejected :)Specifically, I'm looking for how to simulate the effect myself (or something similar).
Itay
Technically... this is an undocumented API, not a private API? It looks like you're still using the publicly available function calls. I think this is probably safe to use, but I'd throw in a flag so you can fall back to a lame effect if they disagree.
Ben Gotow
I'd like to believe you're right, but my intuition is telling me otherwise. I'll probably end up coming up with a different transition, unless somebody has some idea about how to implement this.
Itay
+1  A: 

It seems to be a complex combination of 2D and 3D transformations. :-\ You'd have to really delve into CoreAnimation to simulate this effect.

LucasTizma
A: 

This is a realy nice question .. i like to thank you for asking it

Johnny Mast
+1  A: 

I would do it with an affine transformation applied to the view's layer. Linear algebra is not my strong point ;) so I can't specify the exact transformation but my guess would be something like this for the animation:

  • Set the alpha to fade to 0.0 or something close to 0
  • Apply a transform to squish the two bottom corners close to the center
  • Scale down the view to very small
  • move the layer's center down to the bottom of the screen (or wherever you want it to genie to.

That's more or less how I think it would work. You might have to animate these things at different times, or all in one block, I'm not quite sure.

Have a look at documentation for CALayer, CABasicAnimation, and CGAffineTransform.

jbrennan
A: 

Has anyone implemented this animation and show us the code?

JR