A customizable side menu for iOS projects written in Swift. Multiple menu animation types supported!
To run the example project, clone the repo, and run pod install
from the Example directory first.
PGSideMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "PGSideMenu"
See example project for usage.
Setup you side menu with a content, left and right controller.
let sideMenuController = PGSideMenu()
let contentController = YourContentController()
let leftMenuController = YourLeftMenuController()
let rightMenuController = YourRightMenuController()
sideMenuController.addContentController(contentController)
sideMenuController.addLeftMenuController(leftMenuController)
sideMenuController.addRightMenuController(rightMenuController)
self.window?.rootViewController = sideMenuController
Choose which animation mode you want to use.
sideMenuController.animationType = .slideInRotate
Toggle the menu
sideMenuController.toggleLeftMenu()
sideMenuController.toggleRightMenu()
Hide whatever menu is shown
sideMenuController.hideMenu()
Disable gesture interaction with menu
sideMenuController.enableMenuPanGesture
- slideIn
- slideOver
- slideInRotate
If you have any suggestion on other animation types, let me know or leave a pull request :)
pgorzelany, piotr.gorzelany@gmail.com
PGSideMenu is available under the MIT license. See the LICENSE file for more info.
Designed taken from: https://www.invisionapp.com/do/sketchappsources