iOS MMDrawerController 侧滑push问题

1.使用MMDrawer时push使用:

  DeviceViewController *device = [[DeviceViewController alloc] init];
  [self.navigationController pushViewController:device animated:YES];

如下图所示无法push,原始是self.navigationController是null.


iOS MMDrawerController 侧滑push问题_第1张图片
Untitled.gif

2.于是改成代码如下

DeviceViewController *device = [[DeviceViewController alloc] init];
RootTabController * tab  = (RootTabController*)self.mm_drawerController.centerViewController;
RootNavController *nav = tab.viewControllers[0];
[nav pushViewController:device animated:NO]; 
[self.mm_drawerController closeDrawerAnimated:YES completion:^(BOOL finished) {
     [self.mm_drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeNone];
}];

会出现其他的tabbar无法Push.


iOS MMDrawerController 侧滑push问题_第2张图片
Untitled.gif

3.后来检查发现是因为nav的问题,将代码改成:

RootNavController *nav = tab.viewControllers[tab.selectedIndex];
iOS MMDrawerController 侧滑push问题_第3张图片
Untitled.gif

你可能感兴趣的:(iOS MMDrawerController 侧滑push问题)