{"id":13696633,"url":"https://github.com/wwmz/WMZDropDownMenu","last_synced_at":"2025-05-03T17:31:39.813Z","repository":{"id":38867720,"uuid":"225034536","full_name":"wwmz/WMZDropDownMenu","owner":"wwmz","description":"🌹一个能几乎实现所有App各种类型筛选菜单的控件,可悬浮,目前已实现闲鱼/美团/Boss直聘/京东/饿了么/淘宝/拼多多/赶集网/美图外卖等等的筛选菜单,可以自由调用代理实现自己想组装的筛选功能和UI,且控件的生命周期自动管理,悬浮自动管理🌹(A control that can implement almost all types of filtering menus of all apps)","archived":false,"fork":false,"pushed_at":"2022-09-28T08:59:12.000Z","size":6313,"stargazers_count":732,"open_issues_count":9,"forks_count":98,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-04T11:14:36.242Z","etag":null,"topics":["allmenu","custom","custommenu","dropmenu","menu"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wwmz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-30T15:49:26.000Z","updated_at":"2025-03-28T08:39:58.000Z","dependencies_parsed_at":"2022-07-11T04:00:24.632Z","dependency_job_id":null,"html_url":"https://github.com/wwmz/WMZDropDownMenu","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwmz%2FWMZDropDownMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwmz%2FWMZDropDownMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwmz%2FWMZDropDownMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwmz%2FWMZDropDownMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wwmz","download_url":"https://codeload.github.com/wwmz/WMZDropDownMenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252226767,"owners_count":21714866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allmenu","custom","custommenu","dropmenu","menu"],"created_at":"2024-08-02T18:00:43.860Z","updated_at":"2025-05-03T17:31:39.169Z","avatar_url":"https://github.com/wwmz.png","language":"Objective-C","funding_links":[],"categories":["UI Components"],"sub_categories":[],"readme":"# WMZDropDownMenu \n\n [![Platform](https://img.shields.io/badge/platform-iOS-red.svg)](https://developer.apple.com/iphone/index.action) \n [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/WMZDropDownMenu.svg)](https://img.shields.io/cocoapods/v/WMZDropDownMenu.svg)\n [![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://mit-license.org) \n\n实现功能\n==============\n- 组合自定义功能\n- 支持自定义多选|单选|复选\n- 支持自定义弹出的动画  (目前已实现向下,向左全屏,向右全屏,拼多多对话框弹出,boss直聘全屏弹出)\n- 支持自定义tableView/collectionView头尾视图\n- 支持自定义全局头尾视图\n- 支持自定义collectionCell/tableViewCell视图\n- 支持自定义标题\n- 支持自定义点击回收视图\n- 支持自定义回收列表\n- 支持任意级的联动(由于数据比较庞杂,暂时自动适配不了无限级的联动,所以需要你调用一个方法更新数据传给我,详情看Demo)\n- 支持嵌套使用,即两个筛选菜单可以连着使用\n- 支持放在放在任意视图上\n- 支持控制器消失自动关闭视图，无须再控制器消失方法里手动关闭\n- 链式实现所有配置的自定义修改\n(总之，你想要的基本都有,不想要的也有)\n\n### 下一步 优化使用，增加自定义View的支持 --- 已完成\n\n#目前已经用这控件实现的效果图\n⚠️⚠️⚠️⚠️无须改变源码 只需要调用我的代理组合功能即可⚠️⚠️⚠️⚠️\n\n### 注意：如果弹出的视图的y值不准确 你可以手动设置menu的menuOrignY属性 \n### 也可以设置wPopOraignY属性 \n### 也可以在新增的代理  - (CGFloat)popFrameY; 设置 （1.0.8后才有）\n\n| app筛选菜单                | 图片                       |\n|-----------------------|-----------------------------------------------------|\n| 仿闲鱼筛选菜单               | ![xianyu.gif](https://upload-images.jianshu.io/upload_images/9163368-3df9ac4b45352b4b.gif?imageMogr2/auto-orient/strip)|\n| 仿美团筛选菜单               | ![meituan.gif](https://upload-images.jianshu.io/upload_images/9163368-fc0d363e925e9b84.gif?imageMogr2/auto-orient/strip)|\n| 饿了么筛选菜单              |![eleme.gif](https://upload-images.jianshu.io/upload_images/9163368-ab4ba51a21353c50.gif?imageMogr2/auto-orient/strip)|\n | 京东筛选菜单              | ![Jingdong.gif](https://upload-images.jianshu.io/upload_images/9163368-52beb31fc6f2f0bf.gif?imageMogr2/auto-orient/strip)|\n|拼多多筛选菜单              |![pinduoduo.gif](https://upload-images.jianshu.io/upload_images/9163368-00eba09306587483.gif?imageMogr2/auto-orient/strip) |\n| 简书筛选菜单             |![jianshu.gif](https://upload-images.jianshu.io/upload_images/9163368-086566f77b9bdab7.gif?imageMogr2/auto-orient/strip) |\n| 赶集网筛选菜单              |![ganjiwang.gif](https://upload-images.jianshu.io/upload_images/9163368-8de1befc145ee6f7.gif?imageMogr2/auto-orient/strip) |\n|美团外卖筛选菜单              | ![meituanwaimai.gif](https://upload-images.jianshu.io/upload_images/9163368-fa0d57fa3b89bf9e.gif?imageMogr2/auto-orient/strip)|\n|Boss直聘筛选菜单           |![Boss.gif](https://upload-images.jianshu.io/upload_images/9163368-289df75bc0c8e07b.gif?imageMogr2/auto-orient/strip) |\n|唯品会筛选菜单          | ![weipinhui.gif](https://upload-images.jianshu.io/upload_images/9163368-bfab522a0eb631a3.gif?imageMogr2/auto-orient/strip)|\n|一淘筛选菜单          | ![yitao.gif](https://upload-images.jianshu.io/upload_images/9163368-56393dc9b1003fdf.gif?imageMogr2/auto-orient/strip)|\n\n\n#我手机只有这么一些app了。。~ ~ 总之，目前的app的筛选样式几乎都能实现，当然细节要自己去调\n\n用法（组装全在一些代理里,代理方法可能有点多~ ~,不过只有两个是必实现的,其他的都是可选的）\n==============\n    WMZDropMenuDelegate \n    @required 一定实现的方法\n    */\n    - (NSArray*)titleArrInMenu:(WMZDropDownMenu *)menu;\n    /*\n    *返回WMZDropIndexPath每行 每列的数据\n    */\n    - (NSArray*)menu:(WMZDropDownMenu *)menu \n    dataForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n    @optional 可选实现的方法\n    /*\n    *返回setion行标题有多少列 默认1列\n    */\n    - (NSInteger)menu:(WMZDropDownMenu *)menu numberOfRowsInSection: \n     (NSInteger)section;\n     /*\n     *自定义tableviewCell内容 默认WMZDropTableViewCell 如果要使用默认的 \n      cell返回 nil\n     */\n     - (UITableViewCell*)menu:(WMZDropDownMenu *)menu \n     cellForUITableView:(WMZDropTableView*)tableView AtIndexPath: \n     (NSIndexPath*)indexpath dataForIndexPath:(WMZDropTree*)model;\n     /*\n     *自定义tableView headView\n     */\n     - (UITableViewHeaderFooterView*)menu:(WMZDropDownMenu *)menu \n     headViewForUITableView:(WMZDropTableView*)tableView \n     AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n     /*\n     *自定义tableView footView\n     */\n     - (UITableViewHeaderFooterView*)menu:(WMZDropDownMenu *)menu \n     footViewForUITableView:(WMZDropTableView*)tableView \n     AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n\n     /*\n     *自定义collectionViewCell内容\n     */\n     - (UICollectionViewCell*)menu:(WMZDropDownMenu *)menu \n     cellForUICollectionView:(WMZDropCollectionView*)collectionView\n     AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: \n    (NSIndexPath*)indexpath dataForIndexPath:(WMZDropTree*)model;\n     /*\n    *自定义collectionView headView\n    */\n    - (UICollectionReusableView*)menu:(WMZDropDownMenu *)menu \n    headViewForUICollectionView:(WMZDropCollectionView*)collectionView \n    AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: \n    (NSIndexPath*)indexpath;\n\n    /*\n    *自定义collectionView footView\n    */\n    - (UICollectionReusableView*)menu:(WMZDropDownMenu *)menu \n    footViewForUICollectionView:(WMZDropCollectionView*)collectionView \n    AtDropIndexPath:(WMZDropIndexPath*)dropIndexPath AtIndexPath: \n    (NSIndexPath*)indexpath;\n\n    /*\n    *headView标题\n    */\n    - (NSString*)menu:(WMZDropDownMenu *)menu \n    titleForHeadViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n    /*\n    *footView标题\n    */\n    - (NSString*)menu:(WMZDropDownMenu *)menu \n    titleForFootViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n\n\n    /*\n    *返回WMZDropIndexPath每行 每列 indexpath的cell的高度 默认35\n    */\n    - (CGFloat)menu:(WMZDropDownMenu *)menu heightAtDropIndexPath: \n     (WMZDropIndexPath*)dropIndexPath AtIndexPath: \n     (NSIndexPath*)indexpath;\n     /*\n    *自定义headView高度 collectionView默认35\n    */\n    - (CGFloat)menu:(WMZDropDownMenu *)menu \n    heightForHeadViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n    /*\n    *自定义footView高度\n    */\n     - (CGFloat)menu:(WMZDropDownMenu *)menu \n    heightForFootViewAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n\n    #pragma -mark 自定义用户交互的每行的头尾视图\n    /*\n     *自定义每行全局头部视图 多用于交互事件\n     */\n     - (UIView*)menu:(WMZDropDownMenu *)menu \n    userInteractionHeadViewInSection:(NSInteger)section;\n     /*\n     *自定义每行全局尾部视图 多用于交互事件\n     */\n     - (UIView*)menu:(WMZDropDownMenu *)menu \n     userInteractionFootViewInSection:(NSInteger)section;\n    #pragma -mark 样式动画相关代理\n     /*\n    *返回WMZDropIndexPath每行 每列的UI样式  默认MenuUITableView\n     注:设置了dropIndexPath.section 设置了 MenuUITableView 那么row则全部 \n     为MenuUITableView 保持统一风格\n     */\n     - (MenuUIStyle)menu:(WMZDropDownMenu *)menu \n     uiStyleForRowIndexPath:(WMZDropIndexPath*)dropIndexPath;\n      /*\n      *返回section行标题数据视图出现的动画样式   默认 \n      MenuShowAnimalBottom\n      注:最后一个默认是筛选 弹出动画为 MenuShowAnimalRight\n      */\n      - (MenuShowAnimalStyle)menu:(WMZDropDownMenu *)menu \n      showAnimalStyleForRowInSection:(NSInteger)section;\n      /*\n      *返回section行标题数据视图消失的动画样式   默认 MenuHideAnimalTop\n      注:最后一个默认是筛选 消失动画为 MenuHideAnimalLeft\n       */\n       - (MenuHideAnimalStyle)menu:(WMZDropDownMenu *)menu \n      hideAnimalStyleForRowInSection:(NSInteger)section;\n      /*\n      *返回WMZDropIndexPath每行 每列的编辑类型 单选|多选  默认单选\n      */\n      - (MenuEditStyle)menu:(WMZDropDownMenu *)menu \n      editStyleForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n      /*\n      *返回WMZDropIndexPath每行 每列 显示的个数\n       注:\n       样式MenuUITableView         默认4个\n       样式MenuUICollectionView    默认1个 传值无效\n       */\n       - (NSInteger)menu:(WMZDropDownMenu *)menu \n      countForRowAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n      /*\n      *WMZDropIndexPath是否显示收缩功能 default \u003e参数 \n       wCollectionViewSectionShowExpandCount 显示\n        */\n       - (BOOL)menu:(WMZDropDownMenu *)menu \n      showExpandAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n\n      /*\n      *WMZDropIndexPath上的内容点击 是否关闭视图 default YES\n      */\n      - (BOOL)menu:(WMZDropDownMenu *)menu \n      closeWithTapAtDropIndexPath:(WMZDropIndexPath*)dropIndexPath;\n\n      /*\n      *是否关联 其他标题 即选中其他标题 此标题会不会取消选中状态 default \n      YES 取消，互不关联\n      */\n      - (BOOL)menu:(WMZDropDownMenu *)menu \n     dropIndexPathConnectInSection:(NSInteger)section;\n\n     #pragma -mark 交互自定义代理\n     /*\n     *cell点击方法\n     */\n      - (void)menu:(WMZDropDownMenu *)menu \n     didSelectRowAtDropIndexPath:(WMZDropIndexPath *)dropIndexPath\n     dataIndexPath:(NSIndexPath*)indexpath data:(WMZDropTree*)data;\n     /*\n     *标题点击方法\n     */\n     - (void)menu:(WMZDropDownMenu *)menu didSelectTitleInSection: \n    (NSInteger)section btn:(WMZDropMenuBtn*)selectBtn;\n     /*\n     *确定方法 多个选择\n      selectNoramalData 转化后的的模型数据\n     selectData 字符串数据\n     */\n     - (void)menu:(WMZDropDownMenu *)menu didConfirmAtSection: \n    (NSInteger)section selectNoramelData:( \n    NSMutableArray*)selectNoramalData selectStringData: \n    (NSMutableArray*)selectData;\n\n\n      /*\n      *自定义标题按钮视图  返回配置 参数说明\n      offset       按钮的间距\n      y            按钮的y坐标   自动会居中\n     */\n     - (NSDictionary*)menu:(WMZDropDownMenu *)menu  \n     customTitleInSection: \n     (NSInteger)section withTitleBtn:(WMZDropMenuBtn*)menuBtn;\n\n     /*\n    *自定义修改默认collectionView尾部视图\n    */\n    - (void)menu:(WMZDropDownMenu *)menu  \n    customDefauultCollectionFootView:(WMZDropConfirmView*)confirmView;\n\n配置-链式语法调用（都是可选实现的）\n==============\n### MenuTitle相关\n| 参数               | 类型      | 作用   (默认值)                                 |\n|------------------------|-----------|-----------------------------------------------------|\n| wBorderShow                | BOOL        | 标题视图是否显示边框 default NO                     |\n| wFixBtnWidth                | CGFLoat        | 固定标题的宽度 default 80   |\n| wMenuTitleEqualCount                | NSInteger| 标题等分个数  用来控制标题的宽度 default 4                       |\n| wMenuLine                | BOOL        | 标题按钮添加下划线 dfault NO   |\n###弹出视图相关相关\n| 参数               | 类型      | 作用   (默认值)                                 |\n|------------------------|-----------|-----------------------------------------------------|\n| wFixDataViewHeight                | CGFLoat        | 固定弹出显示数据层的高度  default 自动计算~\u003e最大为屏幕高度的0.4倍                |\n| wMainRadius                | CGFLoat        | 弹窗视图的圆角 默认0   |\n| wMaxWidthScale                | CGFLoat| 最大屏幕宽度系数 default 0.9                   |\n| wMaxHeightScale                | CGFLoat        | 最大屏幕高度系数 default 0.4  |\n| wDefaultConfirmHeight                | CGFLoat        | 默认确定重置视图的高度  default 40             |\n| wPopViewWidth                | CGFLoat        | 弹出动画为pop时候 视图的宽度  default 屏幕宽度/3   |\n| wShadowColor                | UIColor        | 遮罩层颜色 default 333333  |\n| wShadowAlpha                | CGFLoat| 遮罩层透明度  default 0.4                   |\n| wShadowCanTap                | BOOL        | 遮罩层能否点击 default YES |\n| wShadowShow                | BOOL        | 遮罩层是否显示 default YES            |\n### tableview相关\n| 参数               | 类型      | 作用   (默认值)                                 |\n|------------------------|-----------|-----------------------------------------------------|\n| wTableViewColor                | NSArray        | tableview的颜色 default @[FFFFFF,F6F7FA,EBECF0,FFFFFF]                     |\n| wTextAlignment                | NSTextAlignment        | cell文本居中样式 default left   |\n| wCellSelectShowCheck                | BOOL| tableViewCell 选中显示打钩图片 default YES                 |\n### collectionView相关\n| 参数               | 类型      | 作用   (默认值)                                 |\n|------------------------|-----------|-----------------------------------------------------|\n| wReginerCollectionCells            | NSArray        | 注册自定义的collectionViewCell  如果使用了自定义collectionView 必填否则会崩溃        |\n| wReginerCollectionHeadViews        | NSArray        |注册自定义的collectionViewHeadView  如果使用了自定义collectionViewHeadView 必填   |\n| wReginerCollectionFootViews                | NSArray| 注册自定义的collectionViewFoootView  如果使用了自定义collectionViewFoootView 必填           |\n| wCollectionViewCellSpace        | CGFloat        | colletionCell的间距  default 10 |\n| wCollectionViewCellBgColor                | UIColor|colletionCell背景颜色  default 0x666666        |\n| wCollectionViewCellTitleColor        | UIColor        | colletionCell文字颜色  default 0xf2f2f2|\n| wCollectionViewCellSelectBgColor                | UIColor|colletionCell选中背景颜色  default 0xffeceb|\n| wCollectionViewCellSelectTitleColor        | UIColor        | colletionCell选中文字颜色  default red|\n| wCollectionViewCellBorderWith                | CGFloat| colletionCell borderWidth default 0   |\n| wCollectionViewSectionShowExpandCount        | NSInteger        |colletionView section 超过多少个cell显示收缩按钮 default 6 |\n| wCollectionViewSectionRecycleCount                | NSInteger| colletionView section 回收时候显示的cell数量 default 0   |\n| wCollectionViewDefaultFootViewMarginY        | CGFloat        | colletionViewFootView 距离底部的距离 默认0 当iphonex机型为 20  |\n| wCollectionViewDefaultFootViewPaddingY                | CGFloat|colletionViewFootView 距离顶部的距离 默认0        |\n\n\n# 内容有点多 不过要兼容所有的筛选 需要开放很多接口出来自定义,~ ~\n### 其他具体看demo\n### 如果实在觉得代理繁多,直接看我demo哪个app像你要实现的效果 复制代码 稍加修改哈哈。。。。\n\n### 依赖\nAspects（注意检查下项目有没有已经用过这个AOP库哈,有就删掉一个就行了 一个.h一个.m文件哈）文件比较少 就懒得pod引用其他库了。~ ~直接拉在里面的 \n\n\n安装\n==============\n\n### CocoaPods\n1. 将 cocoapods 更新至最新版本.\n2. 在 Podfile 中添加 `pod 'WMZDropDownMenu', '~\u003e 1.2.0'`。\n3. 执行 `pod install` 或 `pod update`。\n4. 导入 #import \"WMZDropDownMenu.h\"。\n\n### 手动安装\n1. 下载 WMZDropDownMenu 文件夹内的所有内容。\n2. 将 WMZDropDownMenu 内的源文件添加(拖放)到你的工程。\n3. 导入 #import \"WMZDropDownMenu.h\"\n\n使用过程中如果有什么bug或者使用的问题欢迎给我提issue或者加我qq  我看到就会解决\n[简书地址](https://www.jianshu.com/p/366d5bb08766)\n\n\n### 更新日记\n- 20220928 v1.2.4  新增自定义弹出视图 需实现协议WMZDropShowViewProcotol\n- 20220925 v1.2.3  修复#55\n- 20220524 v1.2.2  修复#53\n- 20220418 v1.2.1  适配ios15 \n- 20211015 v1.2.0  适配ios15 \n- 20210519 v1.1.6  修复#39\n- 20210511 v1.1.5  修复快速点击的问题\n- 20210422 v1.1.4  修复若干问题,去除警告\n- 20201217 v1.1.3  新增自适应cell宽度样式 新增手动触发选中\n- 20201023 v1.1.2  新增自定义更新标题\n- 20200901 v1.1.1  \n- 20200801 v1.1.0  新增重置代理/修复bug\n- 20200801 v1.0.9  新增自定义修改弹出视图frame的属性\n- 20200716 v1.0.8  新增动态弹出视图位置的代理/新增弹出视图放置的视图的代理(collectionview/scrollView)\n- 20200606 v1.0.7  新增一些代理方法\n- 20200328 v1.0.6  修复bug\n- 20200328 v1.0.5  新增查看更多功能 详情看京东demo\n- 20200117 v1.0.4  过年前更一波\n- 20191220 v1.0.3  修复退出后台数据源被自动清理掉的bug\n- 20191213 v1.0.2  新增更新任意数据的方法\n- 20191206 v1.0.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwmz%2FWMZDropDownMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwwmz%2FWMZDropDownMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwmz%2FWMZDropDownMenu/lists"}