Home

Awesome

IGLDropDownMenu

An iOS drop down menu with pretty animation.

Screenshot

How To Use

Use CocoaPods:

pod 'IGLDropDownMenu'

Manual Install:

Just drap the files in folder IGLDropDownMenu to your project.

####!Try the demo. It's really helpful!

Sample Code

  1. Create your IGLDropDownItem array and set up

    NSMutableArray *dropdownItems = [[NSMutableArray alloc] init];
    IGLDropDownItem *item = [[IGLDropDownItem alloc] init];
    [item setIconImage:[UIImage imageNamed:@"icon.png"]];
    [item setText:@"title"];
    [dropdownItems addObject:item];
    
  2. Create your IGLDropDownMenu and set the up the parameter name dropDownItems

    IGLDropDownMenu *dropDownMenu = [[IGLDropDownMenu alloc] init];
    [dropDownMenu setFrame:CGRectMake(0, 0, 200, 45)];
    dropDownMenu.menuText = @"Choose Weather";
    dropDownMenu.menuIconImage = [UIImage imageNamed:@"chooserIcon.png"];
    dropDownMenu.paddingLeft = 15;  // padding left for the content of the button
    
  3. modify the params of IGLDropDownMenu

    dropDownMenu.type = IGLDropDownMenuTypeStack;
    dropDownMenu.gutterY = 5;
    dropDownMenu.itemAnimationDelay = 0.1;
    dropDownMenu.rotate = IGLDropDownMenuRotateRandom;
    
  4. Call the reloadView method (Very Important!)

    // every time you change the params you should call reloadView method
    [dropDownMenu reloadView];
    

Parameters

These are just some of the parameters you can use, you can find more(or make more) in the code.

####For IGLDropDownMenu

####For IGLDropDownItem

Remember the menuButton in IGLDropDownMenu is also an IGLDropDownItem.

CustomView

If you want to control the view by yourself, you can use the initWithMenuButtonCustomView of IGLDropDownMenu and initWithCustomView of IGLDropDownItem. If you use customView, the customView will auto set userInteractionEnabled = NO and the menu menuButtonStatic = YES and some style parameters will be invalid. You need to handle it yourself. I make a customView in the demo, try it!

Delegate

####For IGLDropDownMenu

Requirements

Thanks

This drop-down menu idea is come from here, I found this demo one day and just implement it on iOS.

License

The MIT License (MIT)

Copyright (c) 2014 Galvin Li

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.