Friday, 15 July 2011

iphone - Using pkrevealcontroller on existing Xcode storyboard -



iphone - Using pkrevealcontroller on existing Xcode storyboard -

i trying integrate pkrevealcontroller sliding menu existing ios project has existing storyboard segues, etc. extended uinavigationviewcontroller , linked new class nav controller on storyboard. in app delegate following:

mainnavviewcontroller *frontviewcontroller = [[mainnavviewcontroller alloc] initwithrootviewcontroller:[[myrootviewcontroller alloc] init]]; uiviewcontroller *rightviewcontroller = [[menuviewcontroller alloc] init]; self.revealcontroller = [pkrevealcontroller revealcontrollerwithfrontviewcontroller:frontviewcontroller rightviewcontroller:rightviewcontroller options:nil]; self.window.rootviewcontroller = self.revealcontroller;

when run application, adds sliding menu icon navigation bar, , frontview slides want it. not using title or segues have added on storyboard. i'm trying possible.

i think problem you're instantiating new frontviewcontroller -- that's not 1 that's in storyboard. i'm not sure how this, seek this. add together uiviewcontroller in storyboard -- alter class pkrevealcontroller, , create initial controller in storyboard, don't hook rest of scenes. give mainnavviewcontroller identifier in ib, alter code in app delegate this:

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.revealcontroller = (pkrevealcontroller *)self.window.rootviewcontroller; uiviewcontroller *rightviewcontroller = [[menuviewcontroller alloc] init]; mainnavviewcontroller *frontviewcontroller = [[uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil] instantiateviewcontrollerwithidentifier:@"frontviewcontroller"]; [self.revealcontroller setfrontviewcontroller:frontviewcontroller]; [self.revealcontroller setrightviewcontroller:rightviewcontroller]; homecoming yes; }

iphone ios uinavigationcontroller storyboard

No comments:

Post a Comment