PaperFold-for-iOS


PaperFold is a simple iOS control that allows hiding of views on the left and right side of the screen by dragging the middle view. The left view supports only 1 fold. The right view supports variable number of folds.

Vertical fold is still in active testing, in an experimental branch (top-multifold) at the moment.


How it works

During folding, a screen capture of the left/right view is taken, and split up depending on the number of folds required. The virtual light source is on the right side of the screen, so surfaces that faces the left are darker. For the right multi-fold view, the fold closes to the 'force' are opened up faster than the folds that is further away.

A sample project is included.

Example

Refer to this link for a video showing the prototype of an app that I was working on. In the end, the proposed project was never completed because I could not obtained reliable data for the app, but I intend to use it for another app.

The animation here looks a bit laggy, but that's because of the low frame rates in GIF.

Requirements

This project uses ARC. If you are not using ARC in your project, add '-fobjc-arc' as a compiler flag for all the files in this project. XCode 4.4 is required for auto-synthesis.

Apps that uses PaperFold

Showy , LargeType , NextRide , SG NextBus , Hangzhou Metro

Contact me if you want your app listed here. Thanks

Other Projects that uses PaperFold

PaperFoldMenuController by me.

PaperFold CocoaPod Demo for RubyMotion by yestoall.

Titanium Mobile Mobule for PaperFold by atsusy.

Known Problem

Screen capture of MKMapView is iOS6 is not taken properly. I approached a few Apple engineers at WWDC, and was told that it is most likely a bug that need to fix. I have already filed a bug report (filed as rdar://11813051, closed by Apple because it is a duplicate of rdar://11650331). Hopefully it will be fixed soon.

Update: This bug is fixed in iOS6b4. No problem taking screenshot of MKMapView.

Credits

Special thanks to @dilliontan, my colleague in buUuk for explaining CAAffineTransform. He's a master at that :p. I'm still a noob. You can check out his iOS-Flip-Transform project here.

Contact

twitter.com/honcheng honcheng.com

Tweets about PaperFold-for-iOS


looking for a very cool way to open/close a Facebook-like side-menu on your iOS app? Take a look at Paper-Fold! https://t.co/HWvwIv6ibc

@mbellinaso

これ試してみよう PaperFold-for-iOS https://t.co/hYCVxoTdRA

@setoh2000

@TimothyWhalin @AndrewPreble A good place to start for folding animations: https://t.co/4zdyJ0y8dM no need to reinvent the wheel

@jaredcomis

honcheng / PaperFold-for-iOS Paper folding animation for iOS http://t.co/f7xim8gkkF #ios

@OBJCLIBBOT

@honcheng I discover your very cool post on https://t.co/d4HfUWjBaL . Searching to do it on Androïd. Did you see it somewhere ? #thanks

@memoristic

PaperFold for iOS: https://t.co/rSCOEIum

@kevinhorek

@matthamm check this out https://t.co/PQnN4g53 #github we're experimenting with folds @fiafo

@fiafo

RT @fiafo: @matthamm check this out https://t.co/PQnN4g53 #github we're experimenting with folds @fiafo

@matthamm

https://t.co/SyDwJGzH น่าสน แปะไว้ก่อน

@indevizible

[PaperFold] Paper folding animation for iOS. https://t.co/gEL2QJb5

@CocoaPods

RT @CocoaPods: [PaperFold] Paper folding animation for iOS. https://t.co/gEL2QJb5

@mikhailmerkulov

RT @CocoaPods: [PaperFold] Paper folding animation for iOS. https://t.co/gEL2QJb5

@solussd

PaperFold https://t.co/muWA39EL #iOS

@a2exandre

Customization is always the key. https://t.co/qzx0q4ed

@thkien

@ja_colme que bueno!!! Se lo paso a mis iOS Gurus! @ajoman @BalbonIV @bonitodlnorte https://t.co/IJbkRNFj

@rabruna

RT @kunfu_code: Efecto IMPRESIONANTE para aplicaciones móviles para iOS... http://t.co/7yHnmtsw

@xisconet

RT @kunfu_code: Efecto IMPRESIONANTE para aplicaciones móviles para iOS... http://t.co/7yHnmtsw

@crisninat

RT @kunfu_code: Efecto IMPRESIONANTE para aplicaciones móviles para iOS... http://t.co/7yHnmtsw

@antocara

RT @kunfu_code: Efecto IMPRESIONANTE para aplicaciones móviles para iOS... http://t.co/7yHnmtsw

@erikorm

RT @kunfu_code: Efecto IMPRESIONANTE para aplicaciones móviles para iOS... http://t.co/7yHnmtsw

@ranbeuer