JVillella / JVFloatingDrawer

An easy to use floating drawer view controller.
MIT License
1.41k stars 158 forks source link

Toggle not working, center drawer corners get rounded #20

Closed ghost closed 8 years ago

ghost commented 8 years ago

Have a weird issue when trying to toggle the left (or right) drawer where nothing happens except that the center view controller suddenly has barely noticeable rounded corners.

Here is my setup:

App Delegate

if let centerViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? UINavigationController, let menuViewController =  UIStoryboard(name: "Menu", bundle: nil).instantiateInitialViewController() as? MenuViewController {

        let drawerViewController = JVFloatingDrawerViewController()
        drawerViewController.leftViewController = menuViewController
        drawerViewController.centerViewController = centerViewController

        UIApplication.sharedApplication().keyWindow?.rootViewController = drawerViewController
    }

Root View (current Center):

@IBAction func didTapMenuBarButtonItem(sender: UIBarButtonItem) {
    if let drawerViewController = parentViewController?.parentViewController as? JVFloatingDrawerViewController {
        drawerViewController.toggleDrawerWithSide(JVFloatingDrawerSide.Left, animated:true, completion:nil)
    }
}

Yes, the drawerViewController is properly called using ' parentViewController?.parentViewController' (I made sure by just setting the new center to the menuViewController and it works without a problem). Yes, I tried just called 'openDrawer...' instead of toggle.

Any suggestions? Also, no I cannot use the Swift version of this library (KGFloatingDrawer) as it requires 'use_frameworks!' in the pod file and right now that breaks Travis CI automated builds.

ghost commented 8 years ago

Ok figured it out. I guess these two properties are REQUIRED to make it work:

        drawerViewController.animator = JVFloatingDrawerSpringAnimator()
        drawerViewController.backgroundImage = UIImage("Menu-Background")