dekatotoro / SlideMenuControllerSwift

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.
MIT License
3.4k stars 754 forks source link

SlideMenu with UITabBarController : Strange behaviour #161

Open corentinfoure opened 8 years ago

corentinfoure commented 8 years ago

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 commented 8 years ago
@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)
                }

            }
        }
    }
aakarshsasi commented 4 years ago

@Nitner0C I have the same issue can you help?