The PKRevealController.h
file is extensively documented. Make yourself familiar with it. There's also a sample project in the Sample/
directory which I recommend you take a look at.
-
Instantiate.
PKRevealController *revealController = [PKRevealController revealControllerWithFrontViewController:front leftViewController:left];
-
Configure.
revealController.delegate = self;
-
Apply.
self.window.rootViewController = revealController;
By importing the PKRevealController.h
file you automatically import an Objective-C category, which extends all UIViewControllers and its descendants with a revealController
property. The result is a behaviour similar to the familiar navigationController
property.
Each of the side controllers that are managed by your reveal controller can specify their own reveal-widths.
For instance in their viewDidLoad
method:
// This could be somewhere in the LeftRearViewController.h file...
- (void)viewDidLoad
{
[super viewDidLoad];
[self.revealController setMinimumWidth:220.0 maximumWidth:244.0 forViewController:self];
}
It is really easy to send messages between controllers, as the revealController
exposes each of those as properties. For instance, from your left view controller you can easily print a description of the front view controller like this:
[self.revealController.frontViewController description];
You can do a lot more. Digg into the PKRevealController.h
header file to find out what methods are at your disposal.