mutualmobile / MMDrawerController

A lightweight, easy to use, Side Drawer Navigation Controller
MIT License
6.76k stars 1.38k forks source link

How to customize this library in Swift? #387

Open thihaaung6245 opened 9 years ago

thihaaung6245 commented 9 years ago

I am now using this library in my Swift project via bridge header First of all it was beautiful library which we can customize everything.

But,I have a little problem with customizing slide out animation in swift which was "parallax" Any help with Swift code example please.

Here is my AppDelegate.swift.

     var rootViewController = self.window!.rootViewController

    let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

    var centerViewController = mainStoryboard.instantiateViewControllerWithIdentifier("CenterViewController") as! CenterViewController

    var leftViewController = mainStoryboard.instantiateViewControllerWithIdentifier("LeftViewController") as! LeftViewController

    var leftSideNav = UINavigationController(rootViewController: leftViewController)
    var centerNav = UINavigationController(rootViewController: centerViewController)

    centerContainer = MMDrawerController(centerViewController: centerNav, leftDrawerViewController: leftSideNav)

    centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView
    centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView;

    centerContainer!.showsShadow = false

    window!.rootViewController = centerContainer
    window!.makeKeyAndVisible()

    return true

sai-prasanna commented 9 years ago

Check this out https://github.com/sascha/DrawerController its mmdrawer in swift