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