Latest 4.2.2
License MIT
Platforms ios 8.0, requires ARC

codebeat badge Join the chat at Travis CI CocoaPods CocoaPods CocoaDocs

SidebarOverlay is an implementation of sidebar menu, similar to ECSlidingViewController. The difference is that in SidebarOverlay the sidebar menu covers the top view when user opens it, like on the picture below:

SidebarOverlay application example


The easiest way to start development using SidebarOverlay is to install it via CocoaPods. Just add it to your Podfile:

source ''
platform :ios, '8.0'

pod 'SidebarOverlay'

Getting Started

It’s quit simple to start developing with SidebarOverlay. First, we have to create three view controllers on our storyboard:

  • container view controller
  • top view controller
  • side view controller

The container view controller is the root view controller that makes all magic for us. It’s necessary to subclass SOContainerViewController and assign it to our container view controller. Then we can setup top and side view controllers:

import SidebarOverlay

class ContainerViewController: SOContainerViewController {

    override func viewDidLoad() {

        self.menuSide = .Right
        self.topViewController = self.storyboard?.instantiateViewControllerWithIdentifier("topScreen")
        self.sideViewController = self.storyboard?.instantiateViewControllerWithIdentifier("leftScreen")


Set the container view controller as initial on your storyboard and your basic application with sidebar is ready to run.

Open sidebar menu programatically

It’s always good if user is able to open sidebar menu not only by swipe gesture, but also by tap on menu button. To open sidebar menu programatically, set isSideViewControllerPresented property of container view controller to true:

class TopViewController: UIViewController {

    @IBAction func showMeMyMenu () {
        if let container = self.so_containerViewController {
            container.isSideViewControllerPresented = true


As you see, we have property named so_containerViewController. This property is automatically added to all view controllers and you’re able to access it everywhere.

To close the sidebar menu, just set the isSideViewControllerPresented property to false.

Changing top view controller from the sidebar menu

Since you’ve implemented your sidebar menu on the left view controller, you need to show different top view controllers each time user chooses an item in menu. It’s pretty simple. Just set the topViewController property of container view controller:

// Table view delegate method that invokes when user chooses an item in UITableView
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    let profileViewController = self.storyboard!.instantiateViewControllerWithIdentifier("profileViewController")
    self.so_containerViewController.topViewController = profileViewController

How To Contribute

Please follow the git-flow notation and make sure that all tests are passing before contributing. Your questions and pull requests are welcome.

Code coverage


We are using semantic versioning.


If you need some help, you can join our gitter room.


SidebarOverlay is released under the MIT license. See LICENSE for details.

Latest podspec

    "name": "SidebarOverlay",
    "version": "4.2.2",
    "summary": "Yet another implementation of sidebar menu, but here your menu appears over the top view controller.",
    "description": "Yet another implementation of sidebar menu, but here your menu appears over the top view controller. You questions and pull requests are wolcome.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Alexander Perechnev": "[email protected]"
    "source": {
        "git": "",
        "tag": "4.2.2"
    "platforms": {
        "ios": "8.0"
    "source_files": "Source/*.{h,m,swift}",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This