https://github.com/bismasaeed00/bsdropdown
It's to show dropdown menu list.
https://github.com/bismasaeed00/bsdropdown
dropdown ios menu objective-c selection
Last synced: about 1 year ago
JSON representation
It's to show dropdown menu list.
- Host: GitHub
- URL: https://github.com/bismasaeed00/bsdropdown
- Owner: bismasaeed00
- Created: 2017-03-22T06:40:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T07:14:56.000Z (over 8 years ago)
- Last Synced: 2025-03-24T08:47:54.862Z (about 1 year ago)
- Topics: dropdown, ios, menu, objective-c, selection
- Language: Objective-C
- Homepage:
- Size: 88.9 KB
- Stars: 15
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BSDropDown
It's show dropdown menu list.

## How To Get Started
Download the project and drop BSDropDownClass into your project.
Don't forget to import the header file.
```
#import "BSDropDown.h"
```
You can create a dropdown with options to show ans add in your view. Here is the example
```
BSDropDown *ddView=[[BSDropDown alloc] initWithWidth:120 withHeightForEachRow:50 originPoint:btn.center withOptions:@[@"option 1",@"option 2",@"option 3",@"option 4",@"option 5"]];
ddView.delegate=self;
// ddView.dropDownBGColor=[UIColor yellowColor];
// ddView.dropDownTextColor=[UIColor greenColor];
// ddView.dropDownFont=[UIFont systemFontOfSize:13];
[self.view addSubview:ddView];
```
You can customize it's backgroud color, font and text color using the commented code above.
The colour of menu button will be the same as defined for the text colour of options in dropdown.
### Delegate
Implement the delegate method to know when user cliceked an option
```
#pragma mark - DropDown Delegate
-(void)dropDownView:(UIView *)ddView AtIndex:(NSInteger)selectedIndex{
NSLog(@"selectedIndex: %li",(long)selectedIndex);
_displayLabel.text=[NSString stringWithFormat:@"options %li",(long)selectedIndex+1];
}
```