ios - Multiple Navigation Controllers -
i having trouble organizing registration/login flow of app. have storyboard entry point of app pointing navigation controller. in appdelegate.m
if user not logged in have:
signupviewcontroller *signupviewcontroller = [[signupviewcontroller alloc] init]; self.navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:signupviewcontroller]; self.window.rootviewcontroller = self.navcontroller; [self.window makekeyandvisible];
this creates 'sign up' navigation controller.
i have tried pop signupviewcontroller
along navigation controller initial screen of app (the navigation controller pointed in storyboard), have not had success.
when use storyboards (and therefore have initial view controller there) ios doing set window.rootviewcontroller
view controller initial view controller flag.
in code replacing root view controller signupviewcontroller
embedded in uinavigationcontroller
, that's why cannot pop because there no other view controller on stack.
one solution add logic on first view controller identifies if user logged in , in case not push (or present modally if will) signupviewcontroller
. hope helps.
Comments
Post a Comment