RevealController à la Facebook for iOS
Ever since the new iteration of the Facebook app (4.0) was released for the iOS platforms, broader masses were introduces to a control scheme, thus far most notably only used by Twitter in it’s own iPad app. Though to be fair they’re not exactly the same. – I disliked the Twitter app, even though I found it hugely innovative, because all those views I was able to toss around simply confused the crap out of me.
Nonetheless, considering how Facebook is easily one of the most popular apps out there, all of you should be familiar with the new concept. Since I wasn’t able to determine whether that concept had an appropriate name other than something with “Reveal” or “Slide” in it, I decided to simply call it “RevealController” whenever I talked about it.
Facebook’s implementation inspired me. I came up with a neat use-case where I was be able to use the same concept in one of my own apps. – Now I only needed the code. – “Github here I come!” I thought to myself, only to end up disappointed.
The implementations I found didn’t impress me as they were unnecessarily complicated, not flexible enough, leaked all over the place and none of them made use of the new UIViewController-Containment that Apple introduced to developers just recently at the WWDC 2011.
Introducing ZUUIRevealController
Hoping to solve all of the aforementioned problems with code that doesn't simply 'suck', I took it upon myself to recreate the Facebook User Experience and thus my own solution was born.
A Facebook inspired custom iOS UIViewController-Container that enables to have a UIViewController on top of another. The rear view can be revealed either by slowly panning the finger across the front view’s NavigationBar, by quickly flicking it left or right or simply by tapping the ‘Reveal’ button.
I decided not to use ARC as it’s still fairly young and lots of projects are not yet ported. Besides it’s easier to port code to ARC than the other way around, seeing how developers failed to manually manage memory for years now - myself included (well sometimes).
The sample project is universal, thus it works both on iPhone and iPad as well as landscape and portrait modes.
The code is released under the BSD-3-Clause License, as I thought it was the most fitting – for me at least. So go ahead, grab a copy at Github and start making great things out of it! Do not hesitate to mail me if you were to have any questions. Comments and feedback are appreciated.