SkillAgentSearch skills...

WMZDropDownMenu

🌹一个能几乎实现所有App各种类型筛选菜单的控件,可悬浮,目前已实现闲鱼/美团/Boss直聘/京东/饿了么/淘宝/拼多多/赶集网/美图外卖等等的筛选菜单,可以自由调用代理实现自己想组装的筛选功能和UI,且控件的生命周期自动管理,悬浮自动管理🌹(A control that can implement almost all types of filtering menus of all apps)

Install / Use

/learn @wwmz/WMZDropDownMenu
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

WMZDropDownMenu

Platform CocoaPods Compatible License

实现功能

  • 组合自定义功能
  • 支持自定义多选|单选|复选
  • 支持自定义弹出的动画 (目前已实现向下,向左全屏,向右全屏,拼多多对话框弹出,boss直聘全屏弹出)
  • 支持自定义tableView/collectionView头尾视图
  • 支持自定义全局头尾视图
  • 支持自定义collectionCell/tableViewCell视图
  • 支持自定义标题
  • 支持自定义点击回收视图
  • 支持自定义回收列表
  • 支持任意级的联动(由于数据比较庞杂,暂时自动适配不了无限级的联动,所以需要你调用一个方法更新数据传给我,详情看Demo)
  • 支持嵌套使用,即两个筛选菜单可以连着使用
  • 支持放在放在任意视图上
  • 支持控制器消失自动关闭视图,无须再控制器消失方法里手动关闭
  • 链式实现所有配置的自定义修改 (总之,你想要的基本都有,不想要的也有)

下一步 优化使用,增加自定义View的支持 --- 已完成

#目前已经用这控件实现的效果图 ⚠️⚠️⚠️⚠️无须改变源码 只需要调用我的代理组合功能即可⚠️⚠️⚠️⚠️

注意:如果弹出的视图的y值不准确 你可以手动设置menu的menuOrignY属性

也可以设置wPopOraignY属性

也可以在新增的代理 - (CGFloat)popFrameY; 设置 (1.0.8后才有)

| app筛选菜单 | 图片 | |-----------------------|-----------------------------------------------------| | 仿闲鱼筛选菜单 | xianyu.gif| | 仿美团筛选菜单 | meituan.gif| | 饿了么筛选菜单 |eleme.gif| | 京东筛选菜单 | Jingdong.gif| |拼多多筛选菜单 |pinduoduo.gif | | 简书筛选菜单 |jianshu.gif | | 赶集网筛选菜单 |ganjiwang.gif | |美团外卖筛选菜单 | meituanwaimai.gif| |Boss直聘筛选菜单 |Boss.gif | |唯品会筛选菜单 | weipinhui.gif| |一淘筛选菜单 | yitao.gif|

#我手机只有这么一些app了。。~ ~ 总之,目前的app的筛选样式几乎都能实现,当然细节要自己去调

用法(组装全在一些代理里,代理方法可能有点多~ ~,不过只有两个是必实现的,其他的都是可选的)

WMZDropMenuDelegate 
@required 一定实现的方法
*/
- (NSArray*)titleArrInMenu:(WMZDropDownMenu *)menu;
/*
*返回WMZDropIndexPath每行 每列的数据
*/
- (NSArray*)menu:(WMZDropDownMenu *)menu 
dataForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
@optional 可选实现的方法
/*
*返回setion行标题有多少列 默认1列
*/
- (NSInteger)menu:(WMZDropDownMenu *)menu numberOfRowsInSection: 
 (NSInteger)section;
 /*
 *自定义tableviewCell内容 默认WMZDropTableViewCell 如果要使用默认的 
  cell返回 nil
 */
 - (UITableViewCell*)menu:(WMZDropDownMenu *)menu 
 cellForUITableView:(WMZDropTableView*)tableView AtIndexPath: 
 (NSIndexPath*)indexpath dataForIndexPath:(WMZDropTree*)model;
 /*
 *自定义tableView headView
 */
 - (UITableViewHeaderFooterView*)menu:(WMZDropDownMenu *)menu 
 headViewForUITableView:(WMZDropTableView*)tableView 
 AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
 /*
 *自定义tableView footView
 */
 - (UITableViewHeaderFooterView*)menu:(WMZDropDownMenu *)menu 
 footViewForUITableView:(WMZDropTableView*)tableView 
 AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;

 /*
 *自定义collectionViewCell内容
 */
 - (UICollectionViewCell*)menu:(WMZDropDownMenu *)menu 
 cellForUICollectionView:(WMZDropCollectionView*)collectionView
 AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: 
(NSIndexPath*)indexpath dataForIndexPath:(WMZDropTree*)model;
 /*
*自定义collectionView headView
*/
- (UICollectionReusableView*)menu:(WMZDropDownMenu *)menu 
headViewForUICollectionView:(WMZDropCollectionView*)collectionView 
AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: 
(NSIndexPath*)indexpath;

/*
*自定义collectionView footView
*/
- (UICollectionReusableView*)menu:(WMZDropDownMenu *)menu 
footViewForUICollectionView:(WMZDropCollectionView*)collectionView 
AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: 
(NSIndexPath*)indexpath;

/*
*headView标题
*/
- (NSString*)menu:(WMZDropDownMenu *)menu 
titleForHeadViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
/*
*footView标题
*/
- (NSString*)menu:(WMZDropDownMenu *)menu 
titleForFootViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;


/*
*返回WMZDropIndexPath每行 每列 indexpath的cell的高度 默认35
*/
- (CGFloat)menu:(WMZDropDownMenu *)menu heightAtDropIndexPath: 
 (WMZDropIndexPath*)dropIndexPath AtIndexPath: 
 (NSIndexPath*)indexpath;
 /*
*自定义headView高度 collectionView默认35
*/
- (CGFloat)menu:(WMZDropDownMenu *)menu 
heightForHeadViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
/*
*自定义footView高度
*/
 - (CGFloat)menu:(WMZDropDownMenu *)menu 
heightForFootViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;

#pragma -mark 自定义用户交互的每行的头尾视图
/*
 *自定义每行全局头部视图 多用于交互事件
 */
 - (UIView*)menu:(WMZDropDownMenu *)menu 
userInteractionHeadViewInSection:(NSInteger)section;
 /*
 *自定义每行全局尾部视图 多用于交互事件
 */
 - (UIView*)menu:(WMZDropDownMenu *)menu 
 userInteractionFootViewInSection:(NSInteger)section;
#pragma -mark 样式动画相关代理
 /*
*返回WMZDropIndexPath每行 每列的UI样式  默认MenuUITableView
 注:设置了dropIndexPath.section 设置了 MenuUITableView 那么row则全部 
 为MenuUITableView 保持统一风格
 */
 - (MenuUIStyle)menu:(WMZDropDownMenu *)menu 
 uiStyleForRowIndexPath:(WMZDropIndexPath*)dropIndexPath;
  /*
  *返回section行标题数据视图出现的动画样式   默认 
  MenuShowAnimalBottom
  注:最后一个默认是筛选 弹出动画为 MenuShowAnimalRight
  */
  - (MenuShowAnimalStyle)menu:(WMZDropDownMenu *)menu 
  showAnimalStyleForRowInSection:(NSInteger)section;
  /*
  *返回section行标题数据视图消失的动画样式   默认 MenuHideAnimalTop
  注:最后一个默认是筛选 消失动画为 MenuHideAnimalLeft
   */
   - (MenuHideAnimalStyle)menu:(WMZDropDownMenu *)menu 
  hideAnimalStyleForRowInSection:(NSInteger)section;
  /*
  *返回WMZDropIndexPath每行 每列的编辑类型 单选|多选  默认单选
  */
  - (MenuEditStyle)menu:(WMZDropDownMenu *)menu 
  editStyleForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
  /*
  *返回WMZDropIndexPath每行 每列 显示的个数
   注:
   样式MenuUITableView         默认4个
   样式MenuUICollectionView    默认1个 传值无效
   */
   - (NSInteger)menu:(WMZDropDownMenu *)menu 
  countForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;
  /*
  *WMZDropIndexPath是否显示收缩功能 default >参数 
   wCollectionViewSectionShowExpandCount 显示
    */
   - (BOOL)menu:(WMZDropDownMenu *)menu 
  showExpandAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;

  /*
  *WMZDropIndexPath上的内容点击 是否关闭视图 default YES
  */
  - (BOOL)menu:(WMZDropDownMenu *)menu 
  closeWithTapAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;

  /*
  *是否关联 其他标题 即选中其他标题 此标题会不会取消选中状态 default 
  YES 取消,互不关联
  */
  - (BOOL)menu:(WMZDropDownMenu *)menu 
 dropIndexPathConnectInSection:(NSInteger)section;

 #pragma -mark 交互自定义代理
 /*
 *cell点击方法
 */
  - (void)menu:(WMZDropDownMenu *)menu 
 didSelectRowAtDropIndexPath:(WMZDropIndexPath *)dropIndexPath
 dataIndexPath:(NSIndexPath*)indexpath data:(WMZDropTree*)data;
 /*
 *标题点击方法
 */
 - (void)menu:(WMZDropDownMenu *)menu didSelectTitleInSection: 
(NSInteger)section btn:(WMZDropMenuBtn*)selectBtn;
 /*
 *确定方法 多个选择
  selectNoramalData 转化后的的模型数据
 selectData 字符串数据
 */
 - (void)menu:(WMZDropDownMenu *)menu didConfirmAtSection: 
(NSInteger)section selectNoramelData:( 
NSMutableArray*)selectNoramalData selectStringData: 
(NSMutableArray*)selectData;


  /*
  *自定义标题按钮视图  返回配置 参数说明
  offset       按钮的间距
  y            按钮的y坐标   自动会居中
 */
 - (NSDictionary*)menu:(WMZDropDownMenu *)menu  
 customTitleInSection: 
 (NSInteger)section withTitleBtn:(WMZDropMenuBtn*)menuBtn;

 /*
*自定义修改默认collectionView尾部视图
*/
- (void)menu:(WMZDropDownMenu *)menu  
customDefauultCollectionFootView:(WMZDropConfirmView*)confirmView;

配置-链式语法调用(都是可选实现的)

MenuTitle相关

| 参数 | 类型 | 作用 (默认值) | |------------------------|-----------|-----------------------------------------------------| | wBorderShow | BOOL | 标题视图是否显示边框 default NO | | wFixBtnWidth | CGFLoat | 固定标题的宽度 default 80 | | wMenuTitleEqualCount | NSInteger| 标题等分个数 用来控制标题的宽度 default 4 | | wMenuLine | BOOL | 标题按钮添加下划线 dfault NO | ###弹出视图相关相关 | 参数 | 类型 | 作用 (默认值) | |------------------------|-----------|-----------------------------------------------------| | wFixDataViewHeight | CGFLoat | 固定弹出显示数据层的高度 default 自动计算~>最大为屏幕高度的0.4倍 | | wMainRadius | CGFLoat | 弹窗视图的圆角 默认0 | | wMaxWidthScale | CGFLoat| 最大屏幕宽度系数 default 0.9 | | wMaxHeightScale | CGFLoat | 最大屏幕高度系数 default 0.4 | | wDefaultConfirmHeigh

View on GitHub
GitHub Stars733
CategoryDevelopment
Updated2d ago
Forks98

Languages

Objective-C

Security Score

100/100

Audited on Mar 30, 2026

No findings