Giter VIP home page Giter VIP logo

sidebaroverlay's Introduction

SidebarOverlay

Join the chat at https://gitter.im/aperechnev/SidebarOverlay

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

Installation

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

source 'https://github.com/CocoaPods/Specs.git'
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
  • left 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 left view controllers:

import SidebarOverlay

class ContainerViewController: SOContainerViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    
        self.topViewController = self.storyboard?.instantiateViewControllerWithIdentifier("topScreen")
        self.leftViewController = 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, call setMenuOpened(true) method of container view controller:

class TopViewController: UIViewController {
    
    @IBAction func showMeMyMenu () {
        if let container = self.so_containerViewController {
            container.setMenuOpened(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 call the setMenuOpened(false) method.

How To Contribute

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

Versioning

We are using semantic versioning.

sidebaroverlay's People

Contributors

gitter-badger avatar

Watchers

Carabineiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.