Giter Club home page Giter Club logo

mvysidemenu's Introduction

MVYSideMenu

iOS Ribbon Menu based on Google+ iPhone app.

Menu animation

##Installation

####CocoaPods Add pod 'MVYSideMenu' to your Podfile.

####Manually Add the MVYSideMenu folder to your project. MVYSideMenu uses ARC. If you have a project that doesn't use ARC, just add the -fobjc-arc compiler flag to the MVYSideMenu files.

##Usage

###Basic Setup

In your app delegate:

#import "MVYSideMenuController.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  // Create your menu view controller
  MVYMenuViewController *menuVC = [[MVYMenuViewController alloc] initWithNibName:@"MVYMenuViewController" bundle:nil];
  // Create your main content view controller
  MVYContentViewController *contentVC = [[MVYContentViewController alloc] initWithNibName:@"MVYContentViewController" bundle:nil];

  // Initialize the MVYSideMenuController
  MVYSideMenuController *sideMenuController = [[MVYSideMenuController alloc] initWithMenuViewController:menuVC contentViewController:contentVC options:options];

  // Add to the window
  self.window.rootViewController = sideMenuController;
  [self.window makeKeyAndVisible];
  
  return YES;
}

You can also initialize it with your custom options:

MVYSideMenuOptions *options = [[MVYSideMenuOptions alloc] init];
options.menuViewOverlapWidth = 60.0f;
options.bezelWidth = 15.0f;
options.contentViewScale = 0.9f; // 1.0f to disable scale
options.contentViewOpacity = 0.5f; // 0.0f to disable opacity
options.panFromBezel = NO;
options.panFromNavBar = YES;
options.animationDuration = 0.3f;
  
MVYSideMenuController *sideMenuController = [[MVYSideMenuController alloc] initWithMenuViewController:menuVC contentViewController:contentVC options:options];

###Accessing it from a Child View Controller

You only need to import MVYSideMenu in your view controller

#import "MVYSideMenu.h"

MVYSideMenuController *sideMenuController = [self sideMenuController];

Closing and Opening menu

// Close menu animated
[sideMenuController closeMenu];

// Open menu animated
[sideMenuController openMenu];

Changing view controllers

OtherContentViewController *otherContentVC = [[OtherContentViewController alloc] initWithNibName:@"OtherContentViewController" bundle:nil];
[sideMenuController changeContentViewController:otherContentVC closeMenu:YES];

OtherMenuViewController *otherMenuVC = [[OtherMenuViewController alloc] initWithNibName:@"OtherMenuViewController" bundle:nil];
[sideMenuController changeMenuViewController:otherMenuVC closeMenu:YES];

Requirements

Requires iOS 5.0 and ARC.

Contributing

Forks, patches and other feedback are welcome.

Creator

Álvaro Murillo @alvaromurillop

License

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

mvysidemenu's People

Contributors

abalbontin avatar alvaromurillo avatar awayo avatar cjwirth avatar wcwynn avatar

Watchers

 avatar  avatar

Forkers

lazarolmneto

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.