左右侧边栏+ tabbarController(IOS Objectivec)

时间:2016-11-22 13:08:21

标签: ios objective-c

以下是流程我想要Loginvc-> tabbarvcontroller(4tab)(也有左右侧边栏)

enter image description here

我的问题是

我想做 1)登录后隐藏后退按钮+添加左侧右侧栏+ tabbarcontroller

但是当我实现backbarbutton不是hide并且它加载了tabbarcontroller页面而不是tab1。

非常感谢

2 个答案:

答案 0 :(得分:0)

尝试以下步骤:

1. set TabViewControllerID  in storyboard . and then set tabbarView controller as rootviewcontroller of app delegate using app delegate object after successful login.


 UITabBarController * tabBarController = [storyboard instantiateViewControllerWithIdentifier:@"TabbarControllerID"];
 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 appDelegate.window.rootViewController = tabBarController;

2 . Add left bar button in your tabViewController’s Viewcontroller .

3. and use MFSideMenu third party library for left and right menu.

for library:https://github.com/mikefrederick/MFSideMenu

答案 1 :(得分:0)

UIStoryboard*Storyboard=[AppDelegate storyBoardType];

    tbTBC *tabvc=(tbTBC*)[Storyboard instantiateViewControllerWithIdentifier:@"tbTBCId"];
    NSLog(@"tabvc controller ===>%@",tabvc.viewControllers);
    tabvc.selectedIndex=3;//set tabbar index number to push on that particular tab bar


    [self.revealViewController setFrontViewController:tabvc];
    [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];