From dc90d7ab0417bbb89ef597311fd3a223216a00ce Mon Sep 17 00:00:00 2001 From: stubbornness1219 <18223847097@163.com> Date: Sun, 19 Jun 2016 16:37:28 +0800 Subject: [PATCH] V0.0.1 --- Pod/Imgs.bundle/icon_chose_bottom@2x.png | Bin 2226 -> 0 bytes README.md | 155 +++++++++++++++++++++++ 2 files changed, 155 insertions(+) delete mode 100755 Pod/Imgs.bundle/icon_chose_bottom@2x.png diff --git a/Pod/Imgs.bundle/icon_chose_bottom@2x.png b/Pod/Imgs.bundle/icon_chose_bottom@2x.png deleted file mode 100755 index 176bdc1142b663b9fec5f5cda0dda35f6f4db56b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2226 zcmbVOdsGuw8owY=3WwGrj{@5o!rEFTkI9onKtcjSd592!3W9k|Adt+&WFQf(Qdo)} z4(PU9l;yZ6=psl2mW?1$z*iBwz_Efk~#5Bvc3@uvlb>!DO)@Zvu@9(I`~>Wsx8Tm&xMN z*o2jbh+9)jW!z{%@QN+`%a53fVJa?#qSb22S~?k3r%)gchhxT|(MY%iNwW{ZL^=|p z@mfU?z#55KuEOLfLNFtW#ApWQN5nmS8G=$35%CHb(X1p2PZ>ogQc)l>m7-Ld<64&1 zVA1feZoF1nBiyHgDbcV7%}`75ddR$1mGRvDz9F+9?hSXlT8}( zHZlx=)nKTAC)5p&n-aDYL*M;+>Ui$CTb~s3PL`UUEVQmolnZa1=G+QB^-y0a>kqHH z+%NrL&BG;%XT$avDad2GJES)b`8PS(1?+gsnfuS(4eyn3`MpbB#S*diO)g4WM0O(P>`-`-PR!nSUV0^fRzE+x)1 z{3%-BtDv1cXj{OI)63==TTXP2Cbreg4n~2U$GpG#xVS?)-yihMEzkf|HSv}-k|%GHv9FQvo(p{* zTbAAldFjXr*}aL$$=x8#do1w#A;swN&z}06al3M`6?N9$JyTYU8KfT37lh+eQyuSp zel1n^tW*V)nZl4&IsAy?e6KrqeSk`O2KI z_K`);hjmXnx)LA16|2u&H>T#C?@3#Hw|w`F>Ylemg_VUH@{NZNE!L!c=;i9_T9(AO z1&7?}*`TQS+FvHRP7hZ`xTH1JP+iI+-0ZNQ<|>UjzP`TCr=z02W9P=|&#~@??7F|* z;J)3^9CkR~FX}z3PNgz0AYFsOff}^bn%#Wk7SdvGqE*yZh4wa@^w7>}+Rs&+U9} z9z#Fe($X?$v==wL_>TQ)Z$|d|cJD#qvll1B6WbE!5}K;Yk~yj?f0H@pU%%BoTNV4w zze*IW{^?rbri7)Dn=S=sNpYJ!n!3w}IxO0t^0x`u6=zFWdDVAxVz;oGr1W^B$qu>p z?|+PcX$eU3(Eie_(A{o+UGMD7v#BV;CW1{l>-3Bu7O)+f5$oU5#M|v;5ESS4!pzg-wB*5 zV3|I@y*V8B**542916901** + +## Features +* 最简单,最快速的操作方式 + +## System Requirements +iOS 8.0 or above + +## Installation +### As a CocoaPods Dependency +Add the following to your Podfile: + + pod 'EasyDropDownMenu' + +## Version +**V0.0.1** ---- 2016-6-19 + +* 首次发版 + +## Example + import UIKit +import EasyDropDownMenu + +class ViewController: UIViewController, YXJDropDownMenuDelegate, YXJDropDownMenuDataSource { + + lazy var classifys = ["美食", "今日新单", "电影", "酒店"] + lazy var cates = ["自助餐", "快餐", "火锅", "日韩料理", "西餐", "烧烤小吃"] + lazy var movices = ["内地剧", "港台剧", "英美剧"] + lazy var hostels = ["经济酒店", "商务酒店", "连锁酒店", "度假酒店", "公寓酒店"] + lazy var areas = ["全城", "芙蓉区", "雨花区", "天心区", "开福区", "岳麓区"] + lazy var sorts = ["默认排序", "离我最近", "好评优先", "人气优先", "最新发布"] + + lazy var menu = YXJDropDownMenu.init(origin: CGPointMake(0, 64), andHeight: 44) + + override func viewDidLoad() { + super.viewDidLoad() + + // self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title:"重新加载", style:UIBarButtonItemStyle.Plain, target:self, action:"menuReloadData") + + // 添加下拉菜单 + self.menu.delegate = self + self.menu.dataSource = self + + self.menu.textColor = UIColor.blackColor() + self.menu.textSelectedColor = UIColor.init(red: 69.0 / 255.0, green: 198 / 255.0, blue: 190 / 255.0, alpha: 1) + self.view.addSubview(menu) + + // 创建menu 第一次显示 不会调用点击代理,可以用这个手动调用 + menu.selectDefalutIndexPath() + } + + // MARK:右键点击事件 + func menuReloadData() { + self.classifys = ["美食", "今日新单", "电影"] + self.menu.reloadData() + } + // MARK:按钮事件 + func selectIndexPathAction(sender: AnyObject) { + self.menu.selectIndexPath(YXJIndexPath(col: 0, row: 2, item: 2)) + } + + // MARK:YXJDropDownMenuDelegate + func numberOfColumnsInMenu(menu: YXJDropDownMenu!) -> Int { + return 3 + } + func menu(menu: YXJDropDownMenu!, numberOfRowsInColumn column: Int) -> Int { + if (column == 0) { + return self.classifys.count + } else if (column == 1) { + return self.areas.count + } else { + return self.sorts.count + } + } + func menu(menu: YXJDropDownMenu!, titleForRowAtIndexPath indexPath: YXJIndexPath!) -> String! { + if (indexPath.column == 0) { + return self.classifys[indexPath.row] + } else if (indexPath.column == 1) { + return self.areas[indexPath.row] + } else { + return self.sorts[indexPath.row] + } + } + + // MARK: new datasource + func menu(menu: YXJDropDownMenu!, imageNameForRowAtIndexPath indexPath: YXJIndexPath!) -> UIImage! { + if (indexPath.column == 0 || indexPath.column == 1) { + return UIImage(named: "TestImgs.bundle/ic_filter_category_\(indexPath.row)") + } + return nil + } + func menu(menu: YXJDropDownMenu!, imageNameForItemsInRowAtIndexPath indexPath: YXJIndexPath!) -> UIImage! { + if (indexPath.column == 0 || indexPath.column == 1) { + return UIImage(named: "TestImgs.bundle/ic_filter_category_\(indexPath.item)") + } + return nil + } + + // MARK: new datasource + func menu(menu: YXJDropDownMenu!, detailTextForRowAtIndexPath indexPath: YXJIndexPath!) -> String! { + if (indexPath.column < 2) { + return "11" + } + return nil + } + func menu(menu: YXJDropDownMenu!, detailTextForItemsInRowAtIndexPath indexPath: YXJIndexPath!) -> String! { + return "22" + } + func menu(menu: YXJDropDownMenu!, numberOfItemsInRow row: Int, column: Int) -> Int { + if (column == 0) { + if (row == 0) { + return self.cates.count + } else if (row == 2) { + return self.movices.count + } else if (row == 3) { + return self.hostels.count + } + } + return 0 + } + func menu(menu: YXJDropDownMenu!, titleForItemsInRowAtIndexPath indexPath: YXJIndexPath!) -> String! { + if (indexPath.column == 0) { + if (indexPath.row == 0) { + return self.cates[indexPath.item] + } else if (indexPath.row == 2) { + return self.movices[indexPath.item] + } else if (indexPath.row == 3) { + return self.hostels[indexPath.item] + } + } + return nil + } + func menu(menu: YXJDropDownMenu!, didSelectRowAtIndexPath indexPath: YXJIndexPath!) { + if (indexPath.item >= 0) { + print("点击了 \(indexPath.column) - \(indexPath.row) - indexPath.item 项目") + } else { + print("点击了 \(indexPath.column) - \(indexPath.row) 项目") + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + } + +## 极致框架 +* EasySwift是从2014年开始打造的贯穿整个Swift开发的整套解决方案,只为最简单,最高效,最全面,高扩展性,囊括最前沿的架构,思想在其中[EasySwift](https://github.com/stubbornnessness/EasySwift) + +## License +EasyEmoji is licensed under the Apache License, Version 2.0 License. For more information, please see the LICENSE file. +