maxkonovalov / MKDropdownMenu

🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs
MIT License
524 stars 83 forks source link

Multiple Selection in drop down #20

Closed kahantle closed 7 years ago

kahantle commented 7 years ago

Hi maxkonovalov,

This drop down is great but now I want to implement multiple selection in drop down. So how can I achieve this?

Please help me in this.

EddieLukeAtmey commented 7 years ago

The DropDown has this property:

/// Allow multiple rows selection in dropdown. Default = NO.
@property (assign, nonatomic) BOOL allowsMultipleRowsSelection;

And then use this to get selected values:

/// Returns the indexes of selected rows in the specified component or empty set if nothing is selected.
- (NSIndexSet *)selectedRowsInComponent:(NSInteger)component;

@protocol MKDropdownMenuDelegate <NSObject>
@optional
/// Called when a row was tapped. If selection needs to be handled, use `-(de)selectRow:inComponent:` as appropriate.
- (void)dropdownMenu:(MKDropdownMenu *)dropdownMenu didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
maxkonovalov commented 7 years ago

Hi @kahantle, If you want to select multiple rows in one component, please follow EddieLukeAtmey's instructions. Selecting/opening multiple components at once is not possible and is not planned to be added, sorry.

IamArmaan commented 4 years ago

Yes , this is nice library but we are not able to use basic feature like multiple selection. If it will be added then helpful..