Here's a sample project that you should be able to build and run which shows the effect in action; the samplecode currently works for iPhone 3.0 and above.
Download Sample Code
Apple's iBooks Dynamic Page Curl
A week ago at NSConference I decided to try and figure out how Apple performed the page curl animation shown in the iPad announcement keynote.
It ended up being pretty easy to implement, and the page curl code has been in the OS since the beginning (although it's currently a private class - I've filed a radar asking to open the API that you can dupe if you'd like. rdar://problem/7616859). Basically you have to add in the finger angle tracking code and figure out the basic physics to make it believable. My code is pretty rough but it gives you a basic idea of how to get this working.
Here's hoping it's opened up because if it's not, then the iBooks app (distributed through the App Store) will be provably using private APIs which doesn't help anyone.
Here's a sample project that you should be able to build and run which shows the effect in action; the samplecode currently works for iPhone 3.0 and above.
Download Sample Code
Here's a sample project that you should be able to build and run which shows the effect in action; the samplecode currently works for iPhone 3.0 and above.
Download Sample Code
Subscribe to:
Post Comments (Atom)

17 comments:
beautiful work
http://www.rubenswieringa.com/blog/flex-book-component-beta
Steven - I'm a publisher and desperate for information to get my books on the iPad. The page flip is exactly what I need. Do you offer consulting? consultant@publishandmarket.com
Kim
@Jonathan that kind of comment is not appreciated here. Please take it elsewhere
This is exactly what I've been looking for.. really hope this gets opened up in the SDK :) Great work Steven.
Steven: I manage the CoreAnimation team at Apple. Are you interested in working for us?
@Assana if that's a legitimate request, please contact me by email; my vCard is on steventroughtonsmith.com (or my address is same fullname at gmail)
Thanks
-S
Done (and from my Apple account! :)
Hi Steven,
I nice book app called Classics uses page curl too, not sure how they are doing it though.
http://www.classicsapp.com/
I started to rolled my own effect class to handle effects like this...have a look at it here.
http://github.com/epatel/EPGLTransitionView
I created an App-Store-safe approximation of this interface using gradient layers for shadowing and shading. It lacks a few of iBooks' nuances, like tracking touches vertically, but the visual effect is similar:
http://github.com/brow/leaves
@Luke: Classics actually uses a pre-rendered page-flip animation (while scaling the text horizontally to simulate curling). See here: http://darknoon.com/blog/2008/12/08/deconstructing-classicsapp/
wowww, nice app!!
@tom
thanks a lot for your approach. i really like your style - and your kitten. greetz!
Is there any update regarding the proposed source code? I mean if this code is used will it be approved by Apple?
@mongoose54 no, it will absolutely be rejected by Apple. Try Tom or Edward's links above
Post a Comment