evnaz / ENSwiftSideMenu

A simple side menu for iOS written in Swift.
MIT License
1.82k stars 282 forks source link

Present destViewController modally #123

Open zentraedi opened 8 years ago

zentraedi commented 8 years ago

Hi! Congratulations on an excellent library.

I would like to know if there's a way to change the default push behaviour of the destination view controllers and present them modally, just like the Uber menu does.

Thanks in advance

evnaz commented 8 years ago

Hi, You can present view modally by selecting table view's row, but in this case the side menu will not be accessible from modal view controller.

zentraedi commented 8 years ago

Thanks! I used:

self.view.window?.rootViewController?.presentViewController(destViewController, animated: true, completion: nil)
sideMenuController()?.sideMenu?.toggleMenu()

...and everything worked fine

ghost commented 8 years ago

@zentraedi i try to use your sugestion but when i put the view controller in the destViewController i get an error cannot convert value of type "myViewController " to expected argument type "UIViewController". also myviewController is a subclass of UIViewController