Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.66 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.66 KB

KPDropMenu

KPDropMenu is an Objective-C port of HADropDown. It expands and collapses in two directions (up & down). It allows the user to select only one item at a time. One can customize font, color, item height, alignment, etc in code (as well as Interface Builder).

Screenshot

Installation

Simply include KPDropMenu.h and KPDropMenu.m file into your project directory.

Usage

1. Through interface builder :

  • Add UIView in interface builder and change its class from UIView to KPDropMenu

  • Customize Properties with the help of attribute inspector

2. Via code

KPDropMenu *dropNew = [[KPDropMenu alloc] initWithFrame:CGRectMake(8, 250, 150, 50)];
dropNew.delegate = self;
dropNew.items = @[@"Apple", @"Grapes", @"Cherry", @"Pineapple", @"Mango", @"Orange"];
dropNew.title = @"Select Again";
dropNew.itemsFont = [UIFont fontWithName:@"Helvetica-Regular" size:12.0];
dropNew.titleTextAlignment = NSTextAlignmentCenter;
dropNew.DirectionDown = NO;
[self.view addSubview:dropNew];

Delegate Methods

To Use delegate methods, implement KPDropMenuDelegate protocol. All these 3 methods are optional.

-(void)didSelectItem : (KPDropMenu *) dropMenu atIndex : (int) atIntedex;
-(void)didShow : (KPDropMenu *)dropMenu;
-(void)didHide : (KPDropMenu *)dropMenu;

Requirements

iOS 7.0 and later

License

MIT License