Latest 1.0.2
Homepage https://github.com/imadeit/ZLDropdownMenu
License MIT
Platforms ios 8.0, requires ARC
Authors

This version is the original version, I will add more function for it in the future. You can use ZLDropdownMenu to set the condition what you want to filter. If you have any advice or problem, please issue me.

demo1

Usage


First, you should set the datasource and delegate.

    ZLDropDownMenu *menu = [[ZLDropDownMenu alloc] init];
    [self.view addSubview:menu];
    menu.delegate = self;
    menu.dataSource = self;
    [menu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(topView.mas_bottom);
        make.left.right.equalTo(self.view);
        make.height.mas_equalTo(50);
    }];

Second, you should implement the corresponding method.

- (NSInteger)numberOfColumnsInMenu:(ZLDropDownMenu *)menu;
- (NSInteger)menu:(ZLDropDownMenu *)menu numberOfRowsInColumns:(NSInteger)column;
- (NSString *)menu:(ZLDropDownMenu *)menu titleForColumn:(NSInteger)column;
- (NSString *)menu:(ZLDropDownMenu *)menu titleForRowAtIndexPath:(ZLIndexPath *)indexPath;
- (void)menu:(ZLDropDownMenu *)menu didSelectRowAtIndexPath:(ZLIndexPath *)indexPath;

if you wanna change the UI, plese reset ZLDropDownMenuUICalcZLDropDownMenuTitleButton and ZLDropDownMenuCollectionViewCell.


此版本为初版,后续将添加更多功能,使用了Masonry进行布局

效果图

demo

使用方法


ZLDropDownMenu *menu = [[ZLDropDownMenu alloc] init];
[self.view addSubview:menu];
menu.delegate = self;
menu.dataSource = self;
[menu mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.equalTo(topView.mas_bottom);
    make.left.right.equalTo(self.view);
    make.height.mas_equalTo(50);
}];
遵守代理ZLDropDownMenuDelegate和数据源ZLDropDownMenuDataSource,并按照ViewController中设置即可,使用方法和UITableview相似

Latest podspec

{
    "name": "ZLDropdownMenu",
    "version": "1.0.2",
    "summary": "Awesome Dropdown menu for iOS in Objective-C with selected conditions shown under menu.",
    "description": "Awesome Dropdown menu for iOS in Objective-C with selected conditions shown under menu. Conditions can only be selected one at a time in tag form,",
    "homepage": "https://github.com/imadeit/ZLDropdownMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "imadeit": "[email protected]"
    },
    "social_media_url": "http://twitter.com/iMackee",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/imadeit/ZLDropdownMenu.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "ZLDropDownMenu/Categories/*.{h,m}",
        "ZLDropDownMenu/Utils/Masonry/*.{h,m}",
        "ZLDropDownMenu/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This