Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set UITabBar controller as AKSideMenu cotentViewController? #77

Open
KuldeepAIP opened this issue Jan 11, 2021 · 0 comments
Open

Comments

@KuldeepAIP
Copy link

Firstly I have used AKSidemenu and when i press any item from sidemenu i move to particular controller like below.

let contentViewController: TestVC = GlobalData.testStoryBoard().instantiateViewController(withIdentifier: "TestVC") as! TestVC
let navController = UINavigationController.init(rootViewController: contentViewController)
self.sideMenuViewController!.setContentViewController(navController, animated: true)
self.sideMenuViewController?.hideMenuViewController()

but now i want to use UITabBarController so after login i use AKSideMenu & UITabBarController like this.

func setSideMenuAsRootViewController() {
    let ContentViewController: TabBarVC = GlobalData.tabBarStoryBoard().instantiateViewController(withIdentifier: "TabBarVC") as! TabBarVC
    let leftMenuViewController: LeftMenuVC = GlobalData.mainStoryBoard().instantiateViewController(withIdentifier: "LeftMenuVC") as! LeftMenuVC
        
    let sideMenuViewController: AKSideMenu = AKSideMenu(contentViewController: ContentViewController, leftMenuViewController: leftMenuViewController, rightMenuViewController: nil)
        
    self.window?.rootViewController = sideMenuViewController
}

but now when i press any sidemenu item it moves to only UITabBar initial controller. here is my code.

let contentViewController: TabBarVC = GlobalData.tabBarStoryBoard().instantiateViewController(withIdentifier: "TabBarVC") as! TabBarVC
self.sideMenuViewController!.setContentViewController(contentViewController, animated: true)
self.sideMenuViewController?.hideMenuViewController()

1 solution to move UITabBar particular subcontroller is to use UITabBarController selectedIndex.

If there's any proper solution to do that then please suggest me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant