mm_drawerController 的实际使用
柯鸿振
2023-12-01
- (void)setupLeftMenuButton
{
MMDrawerBarButtonItem * leftDrawerButton = [[MMDrawerBarButtonItem alloc] initWithTarget:self action:@selector(leftDrawerButtonPress:)];
[self.navigationItem setLeftBarButtonItem:leftDrawerButton];
}
- (void)leftDrawerButtonPress :(id)sender
{
[self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];//已抽屉的形式切换到左边的controller
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row==0)
{
FocusBooksViewController *focusBook=[[FocusBooksViewController alloc]init];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:focusBook];
[self.mm_drawerController setCenterViewController:nav withCloseAnimation:YES completion:nil];
}
}