SlideMenuControllerSwift icon indicating copy to clipboard operation
SlideMenuControllerSwift copied to clipboard

SlideMenu with UITabBarController : Strange behaviour

Open corentinfoure opened this issue 9 years ago • 2 comments

Hello @dekatotoro, @Pluto-Y ,

I have quite an issue while using the SlideMenuController with a mainViewController being an UITabBarController. Here's my case : I have a tab bar with two tabs and another VC When I'm crawling in the tabs, everything is perfect, but when I show the other view controller that is not related to the tabs, when it's dismissed, the layout of my tabs are broken. The frames are a little too high and we can't see the label in the first tab anymore. error

Here is the code : https://github.com/Nitner0C/slideMenuControllerTabs

corentinfoure avatar May 11 '16 09:05 corentinfoure

@IBAction func changVC(sender: AnyObject) {
        if let button = sender as? UIButton {
            if button.tag < 2 {
                if slideMenuController()?.mainViewController != mainViewController {
                    slideMenuController()?.changeMainViewController(mainViewController, close: true)
                } else {
                    closeLeft()
                }
                if let mainViewController = mainViewController as? UITabBarController {
                    mainViewController.selectedIndex = button.tag
                }
            } else {
                if slideMenuController()?.mainViewController == otherVC {
                    closeLeft()
                } else {
                    slideMenuController()?.changeMainViewController(otherVC, close: true)
                }

            }
        }
    }

corentinfoure avatar May 11 '16 13:05 corentinfoure

@Nitner0C I have the same issue can you help?

aakarshsasi avatar Oct 27 '19 14:10 aakarshsasi