GithubHelp home page GithubHelp logo

urmi1 / cdsidebarcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metazz1/cdsidebarcontroller

0.0 2.0 0.0 1.27 MB

CDSideBarController is a light and easy side bar with custom iOS7 animations and actions

License: MIT License

cdsidebarcontroller's Introduction

CDSideBarController

CDSideBarController is a light and easy side bar with custom iOS7 animations and actions

How does it work ?

  1. Import CDSideBar/CDSideBarController in your project

  2. .h file
    2.1 - #import "CDSideBarController.h" in the header file
    2.2 - Add delegate
    2.3 - Add CDSideBarController *sideBar in your interface
    Should look like this:
    #import "CDSideBarController.h"

@interface ViewController : UIViewController
{
CDSideBarController *sideBar;
}

  1. .m file
    3.1 - In viewDidLoad, create a NSArray that contains your menu images
    3.2 - Create your instance of CDSideBarController with this array
    3.3 - Set self as a delegate to this instance
    Should look like this:
    NSArray *imageList = @[[UIImage imageNamed:@"menuChat.png"], [UIImage imageNamed:@"menuUsers.png"], [UIImage imageNamed:@"menuMap.png"], [UIImage imageNamed:@"menuClose.png"]]; sideBar = [[CDSideBarController alloc] initWithImages:imageList];
    sideBar.delegate = self;
    3.4 - Add the delegate method to be notified each time a menu button is clicked
    • (void)menuButtonClicked:(int)index
      {
      // Execute what ever you want
      }

3.4 - Once you want the sidebar appear, just add :
[sideBar insertMenuButtonOnView:self.view atPosition:CGPointMake(self.view.frame.size.width - 70, 50)];
AtPosition correspond to the position where the show/hide menu button will be displayed

You're all set!

cdsidebarcontroller's People

Contributors

metazz1 avatar

Watchers

James Cloos avatar Urmi 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.