ZBDownMenuView
非常轻量级的下拉筛选菜单
下拉筛选菜单使用方法
-
导入头文件
#import "ZBDownMenuView.h"
-
声明ZBDownMenuView
@property (strong, nonatomic) IBOutlet ZBDownMenuView *downMenuView;
-
配置DownMenuView
- (void)viewDidLoad {
[super viewDidLoad];
[self conflictingDownMenuView];
}
/* 配置DownMenuView */
- (void)conflictingDownMenuView {
_downMenuView.titleArray = [NSArray arrayWithObjects:@"综合排序",@"价格", @"时间", nil];
_downMenuView.dataSourceArr = @[@[@"速度最快", @"评分最高", @"起送价格最低", @"配送费最低", @"人均高到低", @"人均低到高"], @[@"0-50元", @"50-100元", @"100-200元", @"200元以上"], @[@"1分钟以内", @"1-3分钟", @"3-5分钟", @"5分钟以上"]].mutableCopy;
/**
* 回调方式一: block
*/
__weak typeof(self) weakSelf = self;
_downMenuView.conditionBlock = ^(NSString *currentTitle, NSArray *currentTitleArray){
NSString *string = [NSString stringWithFormat:@"您当前选中的是\n(%@)\n 当前所有展示的是\n%@", currentTitle, currentTitleArray];
NSLog(@"%@",string);
};
}
/**
* 回调方式二: delegate,实现<ZBDownMenuViewDelegate>协议
*/
- (void)downMenuView:(ZBDownMenuView *)menuView currentButtonTitle:(NSString *)title andCurrentTitleArray:(NSArray *)currentTitleArray{
[NSString stringWithFormat:@"您当前选中的是\n(%@)\n 当前所有展示的是\n%@", title, currentTitleArray];
}
demo下载地址:https://github.com/biyuhuaping/ZBDownMenuView.git
如果觉得喜欢,给个star哦~
网友评论