GithubHelp home page GithubHelp logo

maxprig / aplslidemenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apploft/aplslidemenu

0.0 2.0 0.0 502 KB

Sliding Hamburger Menu like the one in the Facebook App

License: MIT License

Ruby 2.99% Objective-C 97.01%

aplslidemenu's Introduction

APLSlideMenu

Sliding Hamburger Menu like the one in the Facebook App

  • supports left and right slide menus
  • supports optional swipe gesture support
  • supports device orientations
  • supports optional permanent display of slidemenu in landscape on iPad like an UISplitViewController
  • supports iOS 7 View controller-based status bar appearance
  • supports storyboard setup
  • basic accessibility support

iPhone Screenshot iPad Screenshot

Installation

Install via cocoapods by adding this to your Podfile:

pod "APLSlideMenu"

Usage

APLSlideMenuViewController should, but does not have to be rootViewController. It is initialized via Storyboard or with code in your AppDelegate or an APLSlideMenu subclass.

Storyboard

Just drag custom segues like APLSlideMenuContentSegue, APLSlideMenuLeftMenuSegue or APLSlideMenuRightMenuSegue from your APLSlideMenuViewController to your content and menu view controllers and name the segue identifiers content, leftMenu or rightMenu.

If you are using an exception breakpoint and you are not using all three segues, the exception breakpoint will interrupt execution. To prevent this you might want to use a symbolic breakpoint instead. Use the symbol objc_exception_throw and the condition:

(BOOL)(!(BOOL)[[(NSException *)$r0 reason] hasSuffix:@"has no segue with identifier 'leftMenu'"] && !(BOOL)[[(NSException *)$r0 reason] hasSuffix:@"has no segue with identifier 'rightMenu'"] && !(BOOL)[[(NSException *)$r0 reason] hasSuffix:@"has no segue with identifier 'content'"])

When testing with your simulator instead of a device, you need to deactivate this symbolic breakpoint and add another one, replacing every occurance of $r0 with $eax in the condition.

Code

Import header file:

#import "APLSlideMenuViewController.h"

Initialization example:

id rootViewController = self.window.rootViewController;

if ([rootViewController isKindOfClass:[APLSlideMenuViewController class]]) {
    APLSlideMenuViewController *slideViewController = rootViewController;
    
    // first: configure the slide menu
    slideViewController.bouncing = YES;
    slideViewController.gestureSupport = APLSlideMenuGestureSupportDrag;
    
    // second: set the leftMenuViewController and / or rightMenuViewController
    slideViewController.leftMenuViewController = [MyLeftMenuViewController new];
    slideViewController.rightMenuViewController = [MyRightMenuViewController new];
    
    // third: set the contentViewController
    slideViewController.contentViewController = [MyContentViewController new];
    
} else {
    NSLog(@"Ups, this shouldn't happen");
}

Migration from earlier versions

From 0.0.x

  • rename deprecated menuViewController property to leftMenuViewController
  • rename deprecated showMenu: method calls to showLeftMenu:
  • rename deprecated switchMenu: method calls to switchLeftMenu:

aplslidemenu's People

Contributors

christophergross avatar ecaste avatar ksjun avatar michaelkamphausen avatar nischu avatar ziryanov avatar

Watchers

 avatar  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.