Git Product home page Git Product logo

hmsidemenu's Introduction

HMSideMenu

HMSideMenu allows you to display a menu of items that show from the left, right, top or bottom of a view controller with a delightful animation.

Check this video to see it in action.

screenshot

Features

  • Menu items are UIView subclasses, so they are fully customizable.
  • Supports blocks
  • Works with ARC and iOS >= 5

Installation

  • Drag HMSideMenu folder to your project.
  • Add QuartzCore.framework to your linked frameworks.
  • #import "HMSideMenu.h" where you want to add the control.

Usage

UIView *twitterItem = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[twitterItem setMenuActionWithBlock:^{
    NSLog(@"tapped twitter item");
}];

UIImageView *twitterIcon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[twitterIcon setImage:[UIImage imageNamed:@"twitter"]];
[twitterItem addSubview:twitterIcon];

HMSideMenu *sideMenu = [[HMSideMenu alloc] initWithItems:@[twitterItem]];
[self.sideMenu setVerticalSpacing:1.0f];
[self.view addSubview:self.sideMenu];

Please check the included demo project for more options.

Change log

  • v1.1.1
    • Removed HMSideMenuItem. Control is now initialized with an array of UIView objects. To set action block use [UIView setMenuActionWithBlock:]
  • v1.1.0
    • Added left, top and bottom menu positions
    • Code refactoring
  • v1.0.0
    • Initial release

To do

  • Support for orientation changes.

Credits

Thanks to @bryanoltman's CAAnimation-EasingEquations for the animation easing function.

License

HMSideMenu is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

If this code was helpful, I would love to hear from you.

@HeshamMegid
http://hesh.am

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.