Latest 0.1.0
License MIT
Platforms ios 8.0, requires ARC

[![CI Status]( Li/SideBarMenuController.svg?style=flat)]( Li/SideBarMenuController)


SideBarMenuController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SideBarMenuController"


To run the example project, clone the repo, and run pod install from the Example directory first.

Then simply import the framework:

import SideBarMenuController

Now you have a subclass of UIViewController called SideBarMenuController. To implement the class, you can either make your target viewController a subclass of SideBarMenuController, like this:

class ViewController: SideBarMenuController {
    // Get your storyboard reference. We will need it to put your (main and left)viewControllers 
    // into the SideBarMenuController
    let storyBoard = UIStoryboard(name: "Main", bundle: nil)

    override func viewDidLoad() {
        // Do any additional setup after loading the view, typically from a nib.

    override func didReceiveMemoryWarning() {
        // Dispose of any resources that can be recreated.

    // Initialize the viewController with the required designated init method
    required init?(coder aDecoder: NSCoder) {

        let leftViewController = storyBoard.instantiateViewControllerWithIdentifier("Red")
        let mainViewController = storyBoard.instantiateViewControllerWithIdentifier("Green")

        super.init(leftViewController: leftViewController, mainViewController: mainViewController, overlap: 100)

Or you could simply create an instance of SideBarMenuController and attach to your current viewController:

class ViewController: UIViewController{
  let sideBarMenuController: SideBarMenuController!

  override func viewDidLoad(){
    sideBarMenuController = SideBarMenuController(init method here)

Demo GIF

By default, you could toggle menu with swipe gesture. To toggle menu with other actions like touch(button tapped), you will need delegate between your parent scroll view and other views. Then simply trigger this internal function in your delegate method to toggle the menu:


Internal Methods You May Want to Explore:

// Close the leftViewController
closeMenuAnimated(animated: Bool)

// Open the leftViewController
openLeftMenuAnimated(animated: Bool)

// Open the leftViewController if it is closed, vice versa, close it if it is open 
toggleLeftMenuAnimated(animated: Bool)


Chenglu Li, [email protected]


SideBarMenuController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SideBarMenuController",
    "version": "0.1.0",
    "summary": "A subclass of UIScrollViewController.",
    "description": "A framework to help get started with a sideBar menu",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Chenglu Li": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "SideBarMenuController": [

Pin It on Pinterest

Share This