Coder Social home page Coder Social logo

jwslidemenu's Introduction

Description

My first attempt to duplicate the Facebook iOS app's menu functionality.

The code works, but is a bit more awkward to use than I would like. The idea is that the JWSlideMenuController is a controller container view that can have many child controllers (JWSlideMenuViewControllers) added to it. Each of the children controllers shows up as a menu option in the menu table view that can be toggled by the menu button.

All children added to JWSlideMenuController get set as rootViewControllers in a new instance of JWNavigationController. JWNavigationController acts as a UINavigationController, but one that interacts with the JWSlideMenuController.

ScreenShots

Usage

  1. Clone the repository.
  2. Open the project in Xcode.
  3. Open your project in Xcode.
  4. Drag the JWSlideMenuController to your project.
  5. See the code below.
  6. See the sample projects for more.

Sample Code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    self.window.backgroundColor = [UIColor whiteColor];
    
    //Create a new JWSlideMenuConroller container
    JWSlideMenuController *slideMenu = [[[JWSlideMenuController alloc] init] autorelease];
    
    //Create a child controller to add to it.
    //This needs to be a subclass of JWSlideMenuViewController, which is a subclass of UIViewController
    JWSlideMenuViewController *f = [[[FirstHDViewController alloc]initWithNibName:@"FirstHDViewController" bundle:nil] autorelease];
    
    //Add the child controller to the container controller
    [slideMenu addViewController:f withTitle:@"First" andImage:nil];
    
    //Set the window's rootViewController to the container.
    self.window.rootViewController = slideMenu;
    
    [self.window makeKeyAndVisible];
    return YES;
}

License

This project is released under the MIT license. Please see the LICENSE file included in the project.

What's Next?

These items are being worked on next:

  • Does not build to a library yet.

jwslidemenu's People

Contributors

jeremieweldin avatar

Stargazers

Chiu Hoi Po avatar

Watchers

Chiu Hoi Po avatar James Cloos 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.