我知道这是一个古老的线程,但我会出在这里反正:)
为了PKRevealController用故事板工作基本你就需要三个视图控制器。
BaseController(我把它叫做是),其中获得由PKRevealController怎么回事充当基地为主要内容控制器和导航控制器扩展。
MainController,它被设置为fronViewController。
NaviController,我们基本上使用它作为leftViewController,aka导航菜单。
仅供参考:您可以设计和编码从主板上的MainController和NaviController。
所以这是我们如何做到的;首先,我们需要像这样用PKRevealController扩展BaseController;
@interface MainController : PKRevealController
其次,仍然在BaseController中,将这些行添加到viewDidLoad方法中;
//init the fonrViewController
UIViewController *homeController = [self.storyboard instantiateViewControllerWithIdentifier:@"homeScreen"];
//init the leftViewController
UIViewController *naviContrlller = [self.storyboard instantiateViewControllerWithIdentifier:@"quickNaviScreen"];
[self setFrontViewController:homeController];
[self setLeftViewController:naviContrlller];
然后设置PKRevealController委托为;
self.delegate = self;
就是这样。
我在这里回答了一个类似的问题:[在现有的Xcode Storyboard上使用pkRevealController](http://stackoverflow.com/questions/14824959/using-pkrevealcontroller-on-existing-xcode-storyboard/14825615#14825615) – rdelmar 2013-02-14 23:42:57