ios - Set up side drawer controller -


basically use mmdrawerviewcontroller side drawer , setup storyboard prototype below

enter image description here

and code successful login

uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil];  menuvc *menuviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"menuvc"];  uiviewcontroller *centerviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"vc1"];   mmdrawercontroller *drawer = [[mmdrawercontroller alloc] initwithcenterviewcontroller:centerviewcontroller leftdrawerviewcontroller:menuviewcontroller];  ((vc1 * )centerviewcontroller).drawer = drawer; menuviewcontroller.drawer = drawer;   [drawer setrestorationidentifier:@"mmdrawer"]; [drawer setopendrawergesturemodemask:mmopendrawergesturemodeall]; [drawer setclosedrawergesturemodemask:mmclosedrawergesturemodeall];  [drawer  setdrawervisualstateblock:^(mmdrawercontroller *drawercontroller, mmdrawerside drawerside, cgfloat percentvisible) {      mmdrawercontrollerdrawervisualstateblock block;      block = [[mmexampledrawervisualstatemanager sharedmanager]               drawervisualstateblockfordrawerside:drawerside];      if(block){          block(drawercontroller, drawerside, percentvisible);      }  }];  [self.navigationcontroller pushviewcontroller:drawer animated:yes]; 

problem
when login , push vc1 gives me button(obviously because pushed through nav1)..and if trying hide not able it...don't know why.

so question how can change navigation controller after pushed other navigation controller push nav1 , vc1 want change navigation controller nav2 , if not possible how setup drawer?

note: using mmdrawerviewcontroller can suggest me other drawer controller rid of

in appdelegate

 uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; uinavigationcontroller *navcontroller;  if (i have user data)      navcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"nav1"];  } else {     navcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"nav2"]; }  [self.window setrootviewcontroller:navcontroller];   

so, idea...how resolve this?

in code took away navigation controller @ because on mmdrawer set programatically. code:

var rootviewcontroller = self.window!.rootviewcontroller      let mainstoryboard: uistoryboard = uistoryboard(name: "main", bundle: nil)      var centerviewcontroller  = mainstoryboard.instantiateviewcontrollerwithidentifier("loginpageviewcontroller") loginpageviewcontroller     //var rootviewcontroller = centerviewcontroller      var leftviewcontroller = mainstoryboard.instantiateviewcontrollerwithidentifier("sidebartableviewcontroller") sidebartableviewcontroller     var leftsidenav = uinavigationcontroller(rootviewcontroller: leftviewcontroller)     var centersidenav = uinavigationcontroller(rootviewcontroller: centerviewcontroller)      centercontainer = mmdrawercontroller(centerviewcontroller: centersidenav, leftdrawerviewcontroller: leftviewcontroller)       centercontainer!.opendrawergesturemodemask = mmopendrawergesturemode.panningcenterview    // centercontainer!.opendrawergesturemodemask = mmopendrawergesturemode.none     centercontainer!.closedrawergesturemodemask = mmclosedrawergesturemode.panningcenterview      window!.rootviewcontroller = centercontainer     window!.makekeyandvisible() 

you have navigation controller. second issue on viewcontroller comes after login view controller set navigation bar ! need hide common navigation bar , show navigation bar set manually!


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -