A simple side menu for iOS written in Swift
ENSwiftSideMenu
A lightweight flyover side menu component for iOS with the UIDynamic's bouncing animation, UIGestures and UIBlurEffect. Allows you to use native UINavigationController's logic to manage view controllers. The component is written in Swift.
Requirements
- Xcode 6.3 or higher
- iOS 8 or higher
Installation
CocoaPods
The recommended way for installating ENSwiftSideMenu
is via the CocoaPods package manager
platform :ios, '8.0'
pod 'ENSwiftSideMenu', '~> 0.1.1'
Manual Install
All you need is import ENSideMenu.swift
and ENSideMenuNavigationController.swift
to your project folder.
Usage Example
- Create a root UINavigationController subclassing from ENSideMenuNavigationController
- Create a UIViewController for your side menu
- Initilize the menu view with a source view and menu view controller:
override func viewDidLoad() {
super.viewDidLoad()
sideMenu = ENSideMenu(sourceView: self.view, menuViewController: MyMenuViewController(), menuPosition:.Left)
// show the navigation bar over the side menu view
view.bringSubviewToFront(navigationBar)
}
- To change content view controller use next line in your menu view controller:
sideMenuController()?.setContentViewController(destViewController)
- Check example project for more explanation