├── .gitignore ├── LICENSE ├── README.md ├── ZWPullMenuDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ZWPullMenuDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── ap_more.imageset │ │ ├── Contents.json │ │ ├── ap_more@2x.png │ │ └── ap_more@3x.png │ ├── cc-menu-more.imageset │ │ ├── Contents.json │ │ └── cc-menu-more.png │ ├── down_row_16x16.imageset │ │ ├── Contents.json │ │ ├── down_row_16x16.png │ │ ├── down_row_16x16@2x.png │ │ └── down_row_16x16@3x.png │ ├── icon_add_50x50.imageset │ │ ├── Contents.json │ │ ├── icon_add_50x50.png │ │ ├── icon_add_50x50@2x.png │ │ └── icon_add_50x50@3x.png │ ├── icon_add_white_20x20.imageset │ │ ├── Contents.json │ │ ├── icon_add_white_20x20.png │ │ ├── icon_add_white_20x20@2x.png │ │ └── icon_add_white_20x20@3x.png │ ├── icon_lc_edit.imageset │ │ ├── Contents.json │ │ ├── designRuler_icon_lc_edit@2x.png │ │ └── designRuler_icon_lc_edit@3x.png │ ├── menu.imageset │ │ ├── Contents.json │ │ └── menu.png │ ├── 微信.imageset │ │ ├── Contents.json │ │ └── 微信-2.png │ ├── 微信 │ │ ├── Contents.json │ │ ├── contacts_add_friend_30x30_.imageset │ │ │ ├── Contents.json │ │ │ ├── contacts_add_friend_30x30_@2x.png │ │ │ └── contacts_add_friend_30x30_@3x.png │ │ ├── contacts_add_newmessage_30x30_.imageset │ │ │ ├── Contents.json │ │ │ ├── contacts_add_newmessage_30x30_@2x.png │ │ │ └── contacts_add_newmessage_30x30_@3x.png │ │ └── contacts_add_scan_30x30_.imageset │ │ │ ├── Contents.json │ │ │ ├── contacts_add_scan_30x30_@2x.png │ │ │ └── contacts_add_scan_30x30_@3x.png │ ├── 支付宝.imageset │ │ ├── Contents.json │ │ └── 支付宝.png │ └── 支付宝 │ │ ├── Contents.json │ │ ├── ap_add_friend.imageset │ │ ├── Contents.json │ │ ├── ap_add_friend@2x.png │ │ └── ap_add_friend@3x.png │ │ ├── ap_group_talk.imageset │ │ ├── Contents.json │ │ ├── ap_group_talk@2x.png │ │ └── ap_group_talk@3x.png │ │ ├── ap_help.imageset │ │ ├── Contents.json │ │ ├── ap_help@2x.png │ │ └── ap_help@3x.png │ │ ├── ap_qrcode.imageset │ │ ├── Contents.json │ │ ├── ap_qrcode@2x.png │ │ └── ap_qrcode@3x.png │ │ └── ap_scan.imageset │ │ ├── Contents.json │ │ ├── ap_scan@2x.png │ │ └── ap_scan@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── example │ ├── DemoTableMenuCell.h │ ├── DemoTableMenuCell.m │ └── DemoTableMenuCell.xib └── main.m ├── ZWPullMenuView.podspec └── ZWPullMenuView ├── ZWPullMenuCell.h ├── ZWPullMenuCell.m ├── ZWPullMenuConfig.h ├── ZWPullMenuConfig.m ├── ZWPullMenuModel.h ├── ZWPullMenuModel.m ├── ZWPullMenuView.h └── ZWPullMenuView.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 wangziwu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZWPullMenuView 2 | 3 | ### 框架详细使用介绍:[我的简书](http://www.jianshu.com/p/30cbe5a6c104) 4 | 5 | [http://www.jianshu.com/p/30cbe5a6c104](http://www.jianshu.com/p/30cbe5a6c104) 6 | 7 | 下拉选择视图、支持微信、支付宝等样式。自动计算最优显示位置、动画效果。 8 | 9 | - 支持支付宝首页、微信首页下拉Menu样式。 10 | - 自定义Menu样式 11 | - 自动优化视图方向 12 | - 允许自定义下拉位置 13 | - 支持纯文字、图标文字混合多种模板 14 | - 丰富的初始化方法、智能判断显示模板 15 | 16 | 17 | ### 框架使用方法 18 | - 直接把ZWPullMenuView文件夹拖入到您的工程中. 19 | 20 | ```objc 21 | #import "ZWPullMenuView.h" 22 | ``` 23 | 24 | - Cocoapods安装 25 | 26 | ```objc 27 | pod search ZWPullMenuView 28 | pod 'ZWPullMenuView' 29 | ``` 30 | 31 | 如果发现pod search ZWPullMenuView搜索不到,请执行pod repo update --verbose命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了. 32 | 33 | ![ZWPullMenuView.gif](https://upload-images.jianshu.io/upload_images/3237547-b8a70b8e3e23f927.gif?imageMogr2/auto-orient/strip) 34 | 35 | -------------------------------------------------------------------------------- /ZWPullMenuDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8544FA9A2216BBF100BD3BD1 /* ZWPullMenuConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 8544FA992216BBF100BD3BD1 /* ZWPullMenuConfig.m */; }; 11 | 85A547AB1F5A5C2D00A0C9FF /* ZWPullMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 85A547A51F5A5C2D00A0C9FF /* ZWPullMenuCell.m */; }; 12 | 85A547AD1F5A5C2D00A0C9FF /* ZWPullMenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 85A547A81F5A5C2D00A0C9FF /* ZWPullMenuModel.m */; }; 13 | 85A547AE1F5A5C2D00A0C9FF /* ZWPullMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 85A547AA1F5A5C2D00A0C9FF /* ZWPullMenuView.m */; }; 14 | 85C852A9207CCF33008DBDE7 /* DemoTableMenuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 85C852A6207CCF33008DBDE7 /* DemoTableMenuCell.xib */; }; 15 | 85C852AA207CCF33008DBDE7 /* DemoTableMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 85C852A7207CCF33008DBDE7 /* DemoTableMenuCell.m */; }; 16 | 85FB24501F5414F9006A4924 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 85FB244F1F5414F9006A4924 /* main.m */; }; 17 | 85FB24531F5414F9006A4924 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 85FB24521F5414F9006A4924 /* AppDelegate.m */; }; 18 | 85FB24561F5414F9006A4924 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 85FB24551F5414F9006A4924 /* ViewController.m */; }; 19 | 85FB24591F5414F9006A4924 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85FB24571F5414F9006A4924 /* Main.storyboard */; }; 20 | 85FB245B1F5414F9006A4924 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85FB245A1F5414F9006A4924 /* Assets.xcassets */; }; 21 | 85FB245E1F5414F9006A4924 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85FB245C1F5414F9006A4924 /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 8544FA982216BBF100BD3BD1 /* ZWPullMenuConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZWPullMenuConfig.h; sourceTree = ""; }; 26 | 8544FA992216BBF100BD3BD1 /* ZWPullMenuConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZWPullMenuConfig.m; sourceTree = ""; }; 27 | 85A547A41F5A5C2D00A0C9FF /* ZWPullMenuCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWPullMenuCell.h; sourceTree = ""; }; 28 | 85A547A51F5A5C2D00A0C9FF /* ZWPullMenuCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWPullMenuCell.m; sourceTree = ""; }; 29 | 85A547A71F5A5C2D00A0C9FF /* ZWPullMenuModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWPullMenuModel.h; sourceTree = ""; }; 30 | 85A547A81F5A5C2D00A0C9FF /* ZWPullMenuModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWPullMenuModel.m; sourceTree = ""; }; 31 | 85A547A91F5A5C2D00A0C9FF /* ZWPullMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWPullMenuView.h; sourceTree = ""; }; 32 | 85A547AA1F5A5C2D00A0C9FF /* ZWPullMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWPullMenuView.m; sourceTree = ""; }; 33 | 85C852A6207CCF33008DBDE7 /* DemoTableMenuCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DemoTableMenuCell.xib; sourceTree = ""; }; 34 | 85C852A7207CCF33008DBDE7 /* DemoTableMenuCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableMenuCell.m; sourceTree = ""; }; 35 | 85C852A8207CCF33008DBDE7 /* DemoTableMenuCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableMenuCell.h; sourceTree = ""; }; 36 | 85FB244B1F5414F9006A4924 /* ZWPullMenuDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZWPullMenuDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 85FB244F1F5414F9006A4924 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 85FB24511F5414F9006A4924 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 85FB24521F5414F9006A4924 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 85FB24541F5414F9006A4924 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 41 | 85FB24551F5414F9006A4924 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 42 | 85FB24581F5414F9006A4924 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 85FB245A1F5414F9006A4924 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | 85FB245D1F5414F9006A4924 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 85FB245F1F5414F9006A4924 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 85FB24481F5414F9006A4924 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 85A547A31F5A5C2D00A0C9FF /* ZWPullMenuView */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 85A547A41F5A5C2D00A0C9FF /* ZWPullMenuCell.h */, 63 | 85A547A51F5A5C2D00A0C9FF /* ZWPullMenuCell.m */, 64 | 85A547A71F5A5C2D00A0C9FF /* ZWPullMenuModel.h */, 65 | 85A547A81F5A5C2D00A0C9FF /* ZWPullMenuModel.m */, 66 | 85A547A91F5A5C2D00A0C9FF /* ZWPullMenuView.h */, 67 | 85A547AA1F5A5C2D00A0C9FF /* ZWPullMenuView.m */, 68 | 8544FA982216BBF100BD3BD1 /* ZWPullMenuConfig.h */, 69 | 8544FA992216BBF100BD3BD1 /* ZWPullMenuConfig.m */, 70 | ); 71 | path = ZWPullMenuView; 72 | sourceTree = ""; 73 | }; 74 | 85C852A5207CCF33008DBDE7 /* example */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 85C852A8207CCF33008DBDE7 /* DemoTableMenuCell.h */, 78 | 85C852A7207CCF33008DBDE7 /* DemoTableMenuCell.m */, 79 | 85C852A6207CCF33008DBDE7 /* DemoTableMenuCell.xib */, 80 | ); 81 | path = example; 82 | sourceTree = ""; 83 | }; 84 | 85FB24421F5414F9006A4924 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 85A547A31F5A5C2D00A0C9FF /* ZWPullMenuView */, 88 | 85FB244D1F5414F9006A4924 /* ZWPullMenuDemo */, 89 | 85FB244C1F5414F9006A4924 /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 85FB244C1F5414F9006A4924 /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 85FB244B1F5414F9006A4924 /* ZWPullMenuDemo.app */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 85FB244D1F5414F9006A4924 /* ZWPullMenuDemo */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 85C852A5207CCF33008DBDE7 /* example */, 105 | 85FB24511F5414F9006A4924 /* AppDelegate.h */, 106 | 85FB24521F5414F9006A4924 /* AppDelegate.m */, 107 | 85FB24541F5414F9006A4924 /* ViewController.h */, 108 | 85FB24551F5414F9006A4924 /* ViewController.m */, 109 | 85FB24571F5414F9006A4924 /* Main.storyboard */, 110 | 85FB245A1F5414F9006A4924 /* Assets.xcassets */, 111 | 85FB245C1F5414F9006A4924 /* LaunchScreen.storyboard */, 112 | 85FB245F1F5414F9006A4924 /* Info.plist */, 113 | 85FB244E1F5414F9006A4924 /* Supporting Files */, 114 | ); 115 | path = ZWPullMenuDemo; 116 | sourceTree = ""; 117 | }; 118 | 85FB244E1F5414F9006A4924 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 85FB244F1F5414F9006A4924 /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 85FB244A1F5414F9006A4924 /* ZWPullMenuDemo */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 85FB24621F5414F9006A4924 /* Build configuration list for PBXNativeTarget "ZWPullMenuDemo" */; 132 | buildPhases = ( 133 | 85FB24471F5414F9006A4924 /* Sources */, 134 | 85FB24481F5414F9006A4924 /* Frameworks */, 135 | 85FB24491F5414F9006A4924 /* Resources */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = ZWPullMenuDemo; 142 | productName = ZWPullMenuDemo; 143 | productReference = 85FB244B1F5414F9006A4924 /* ZWPullMenuDemo.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 85FB24431F5414F9006A4924 /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0940; 153 | ORGANIZATIONNAME = wang_ziwu; 154 | TargetAttributes = { 155 | 85FB244A1F5414F9006A4924 = { 156 | CreatedOnToolsVersion = 8.3.3; 157 | ProvisioningStyle = Automatic; 158 | }; 159 | }; 160 | }; 161 | buildConfigurationList = 85FB24461F5414F9006A4924 /* Build configuration list for PBXProject "ZWPullMenuDemo" */; 162 | compatibilityVersion = "Xcode 3.2"; 163 | developmentRegion = English; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | Base, 168 | ); 169 | mainGroup = 85FB24421F5414F9006A4924; 170 | productRefGroup = 85FB244C1F5414F9006A4924 /* Products */; 171 | projectDirPath = ""; 172 | projectRoot = ""; 173 | targets = ( 174 | 85FB244A1F5414F9006A4924 /* ZWPullMenuDemo */, 175 | ); 176 | }; 177 | /* End PBXProject section */ 178 | 179 | /* Begin PBXResourcesBuildPhase section */ 180 | 85FB24491F5414F9006A4924 /* Resources */ = { 181 | isa = PBXResourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 85FB245E1F5414F9006A4924 /* LaunchScreen.storyboard in Resources */, 185 | 85C852A9207CCF33008DBDE7 /* DemoTableMenuCell.xib in Resources */, 186 | 85FB245B1F5414F9006A4924 /* Assets.xcassets in Resources */, 187 | 85FB24591F5414F9006A4924 /* Main.storyboard in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXSourcesBuildPhase section */ 194 | 85FB24471F5414F9006A4924 /* Sources */ = { 195 | isa = PBXSourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | 85FB24561F5414F9006A4924 /* ViewController.m in Sources */, 199 | 85FB24531F5414F9006A4924 /* AppDelegate.m in Sources */, 200 | 85A547AB1F5A5C2D00A0C9FF /* ZWPullMenuCell.m in Sources */, 201 | 85A547AE1F5A5C2D00A0C9FF /* ZWPullMenuView.m in Sources */, 202 | 85A547AD1F5A5C2D00A0C9FF /* ZWPullMenuModel.m in Sources */, 203 | 85FB24501F5414F9006A4924 /* main.m in Sources */, 204 | 8544FA9A2216BBF100BD3BD1 /* ZWPullMenuConfig.m in Sources */, 205 | 85C852AA207CCF33008DBDE7 /* DemoTableMenuCell.m in Sources */, 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | /* End PBXSourcesBuildPhase section */ 210 | 211 | /* Begin PBXVariantGroup section */ 212 | 85FB24571F5414F9006A4924 /* Main.storyboard */ = { 213 | isa = PBXVariantGroup; 214 | children = ( 215 | 85FB24581F5414F9006A4924 /* Base */, 216 | ); 217 | name = Main.storyboard; 218 | sourceTree = ""; 219 | }; 220 | 85FB245C1F5414F9006A4924 /* LaunchScreen.storyboard */ = { 221 | isa = PBXVariantGroup; 222 | children = ( 223 | 85FB245D1F5414F9006A4924 /* Base */, 224 | ); 225 | name = LaunchScreen.storyboard; 226 | sourceTree = ""; 227 | }; 228 | /* End PBXVariantGroup section */ 229 | 230 | /* Begin XCBuildConfiguration section */ 231 | 85FB24601F5414F9006A4924 /* Debug */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | ALWAYS_SEARCH_USER_PATHS = NO; 235 | CLANG_ANALYZER_NONNULL = YES; 236 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 237 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 238 | CLANG_CXX_LIBRARY = "libc++"; 239 | CLANG_ENABLE_MODULES = YES; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 242 | CLANG_WARN_BOOL_CONVERSION = YES; 243 | CLANG_WARN_COMMA = YES; 244 | CLANG_WARN_CONSTANT_CONVERSION = YES; 245 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 246 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 247 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 248 | CLANG_WARN_EMPTY_BODY = YES; 249 | CLANG_WARN_ENUM_CONVERSION = YES; 250 | CLANG_WARN_INFINITE_RECURSION = YES; 251 | CLANG_WARN_INT_CONVERSION = YES; 252 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 253 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 254 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 255 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 256 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 257 | CLANG_WARN_STRICT_PROTOTYPES = YES; 258 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 259 | CLANG_WARN_UNREACHABLE_CODE = YES; 260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 261 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 262 | COPY_PHASE_STRIP = NO; 263 | DEBUG_INFORMATION_FORMAT = dwarf; 264 | ENABLE_STRICT_OBJC_MSGSEND = YES; 265 | ENABLE_TESTABILITY = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu99; 267 | GCC_DYNAMIC_NO_PIC = NO; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_OPTIMIZATION_LEVEL = 0; 270 | GCC_PREPROCESSOR_DEFINITIONS = ( 271 | "DEBUG=1", 272 | "$(inherited)", 273 | ); 274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 278 | GCC_WARN_UNUSED_FUNCTION = YES; 279 | GCC_WARN_UNUSED_VARIABLE = YES; 280 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 281 | MTL_ENABLE_DEBUG_INFO = YES; 282 | ONLY_ACTIVE_ARCH = YES; 283 | SDKROOT = iphoneos; 284 | TARGETED_DEVICE_FAMILY = "1,2"; 285 | }; 286 | name = Debug; 287 | }; 288 | 85FB24611F5414F9006A4924 /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_ANALYZER_NONNULL = YES; 293 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 294 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 295 | CLANG_CXX_LIBRARY = "libc++"; 296 | CLANG_ENABLE_MODULES = YES; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 299 | CLANG_WARN_BOOL_CONVERSION = YES; 300 | CLANG_WARN_COMMA = YES; 301 | CLANG_WARN_CONSTANT_CONVERSION = YES; 302 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 303 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 304 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 305 | CLANG_WARN_EMPTY_BODY = YES; 306 | CLANG_WARN_ENUM_CONVERSION = YES; 307 | CLANG_WARN_INFINITE_RECURSION = YES; 308 | CLANG_WARN_INT_CONVERSION = YES; 309 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 310 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 311 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 313 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 314 | CLANG_WARN_STRICT_PROTOTYPES = YES; 315 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 316 | CLANG_WARN_UNREACHABLE_CODE = YES; 317 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 318 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 319 | COPY_PHASE_STRIP = NO; 320 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 321 | ENABLE_NS_ASSERTIONS = NO; 322 | ENABLE_STRICT_OBJC_MSGSEND = YES; 323 | GCC_C_LANGUAGE_STANDARD = gnu99; 324 | GCC_NO_COMMON_BLOCKS = YES; 325 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 326 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 327 | GCC_WARN_UNDECLARED_SELECTOR = YES; 328 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 329 | GCC_WARN_UNUSED_FUNCTION = YES; 330 | GCC_WARN_UNUSED_VARIABLE = YES; 331 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 332 | MTL_ENABLE_DEBUG_INFO = NO; 333 | SDKROOT = iphoneos; 334 | TARGETED_DEVICE_FAMILY = "1,2"; 335 | VALIDATE_PRODUCT = YES; 336 | }; 337 | name = Release; 338 | }; 339 | 85FB24631F5414F9006A4924 /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 343 | INFOPLIST_FILE = ZWPullMenuDemo/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 345 | PRODUCT_BUNDLE_IDENTIFIER = "wang-ziwu.ZWPullMenuDemo"; 346 | PRODUCT_NAME = "$(TARGET_NAME)"; 347 | }; 348 | name = Debug; 349 | }; 350 | 85FB24641F5414F9006A4924 /* Release */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 354 | INFOPLIST_FILE = ZWPullMenuDemo/Info.plist; 355 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 356 | PRODUCT_BUNDLE_IDENTIFIER = "wang-ziwu.ZWPullMenuDemo"; 357 | PRODUCT_NAME = "$(TARGET_NAME)"; 358 | }; 359 | name = Release; 360 | }; 361 | /* End XCBuildConfiguration section */ 362 | 363 | /* Begin XCConfigurationList section */ 364 | 85FB24461F5414F9006A4924 /* Build configuration list for PBXProject "ZWPullMenuDemo" */ = { 365 | isa = XCConfigurationList; 366 | buildConfigurations = ( 367 | 85FB24601F5414F9006A4924 /* Debug */, 368 | 85FB24611F5414F9006A4924 /* Release */, 369 | ); 370 | defaultConfigurationIsVisible = 0; 371 | defaultConfigurationName = Release; 372 | }; 373 | 85FB24621F5414F9006A4924 /* Build configuration list for PBXNativeTarget "ZWPullMenuDemo" */ = { 374 | isa = XCConfigurationList; 375 | buildConfigurations = ( 376 | 85FB24631F5414F9006A4924 /* Debug */, 377 | 85FB24641F5414F9006A4924 /* Release */, 378 | ); 379 | defaultConfigurationIsVisible = 0; 380 | defaultConfigurationName = Release; 381 | }; 382 | /* End XCConfigurationList section */ 383 | }; 384 | rootObject = 85FB24431F5414F9006A4924 /* Project object */; 385 | } 386 | -------------------------------------------------------------------------------- /ZWPullMenuDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZWPullMenuDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/ap_more.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_more@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_more@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/ap_more.imageset/ap_more@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/ap_more.imageset/ap_more@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/ap_more.imageset/ap_more@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/ap_more.imageset/ap_more@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/cc-menu-more.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "cc-menu-more.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/cc-menu-more.imageset/cc-menu-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/cc-menu-more.imageset/cc-menu-more.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "down_row_16x16.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "down_row_16x16@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "down_row_16x16@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/down_row_16x16.imageset/down_row_16x16@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_add_50x50.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_add_50x50@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon_add_50x50@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_50x50.imageset/icon_add_50x50@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_add_white_20x20.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_add_white_20x20@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon_add_white_20x20@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_add_white_20x20.imageset/icon_add_white_20x20@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_lc_edit.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "designRuler_icon_lc_edit@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "designRuler_icon_lc_edit@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_lc_edit.imageset/designRuler_icon_lc_edit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_lc_edit.imageset/designRuler_icon_lc_edit@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/icon_lc_edit.imageset/designRuler_icon_lc_edit@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/icon_lc_edit.imageset/designRuler_icon_lc_edit@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/menu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "menu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/menu.imageset/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/menu.imageset/menu.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "微信-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信.imageset/微信-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信.imageset/微信-2.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_friend_30x30_.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "contacts_add_friend_30x30_@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "contacts_add_friend_30x30_@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_friend_30x30_.imageset/contacts_add_friend_30x30_@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_friend_30x30_.imageset/contacts_add_friend_30x30_@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_friend_30x30_.imageset/contacts_add_friend_30x30_@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_friend_30x30_.imageset/contacts_add_friend_30x30_@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_newmessage_30x30_.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "contacts_add_newmessage_30x30_@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "contacts_add_newmessage_30x30_@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_newmessage_30x30_.imageset/contacts_add_newmessage_30x30_@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_newmessage_30x30_.imageset/contacts_add_newmessage_30x30_@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_newmessage_30x30_.imageset/contacts_add_newmessage_30x30_@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_newmessage_30x30_.imageset/contacts_add_newmessage_30x30_@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_scan_30x30_.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "contacts_add_scan_30x30_@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "contacts_add_scan_30x30_@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_scan_30x30_.imageset/contacts_add_scan_30x30_@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_scan_30x30_.imageset/contacts_add_scan_30x30_@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_scan_30x30_.imageset/contacts_add_scan_30x30_@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/微信/contacts_add_scan_30x30_.imageset/contacts_add_scan_30x30_@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "支付宝.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝.imageset/支付宝.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝.imageset/支付宝.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_add_friend.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_add_friend@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_add_friend@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_add_friend.imageset/ap_add_friend@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_add_friend.imageset/ap_add_friend@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_add_friend.imageset/ap_add_friend@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_add_friend.imageset/ap_add_friend@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_group_talk.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_group_talk@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_group_talk@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_group_talk.imageset/ap_group_talk@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_group_talk.imageset/ap_group_talk@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_group_talk.imageset/ap_group_talk@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_group_talk.imageset/ap_group_talk@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_help.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_help@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_help@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_help.imageset/ap_help@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_help.imageset/ap_help@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_help.imageset/ap_help@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_help.imageset/ap_help@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_qrcode.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_qrcode@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_qrcode@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_qrcode.imageset/ap_qrcode@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_qrcode.imageset/ap_qrcode@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_qrcode.imageset/ap_qrcode@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_qrcode.imageset/ap_qrcode@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_scan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ap_scan@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "ap_scan@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_scan.imageset/ap_scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_scan.imageset/ap_scan@2x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Assets.xcassets/支付宝/ap_scan.imageset/ap_scan@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangziwu/ZWPullMenuView/8c07f72613dd9e3638751b60c9654ba0ded88ce2/ZWPullMenuDemo/Assets.xcassets/支付宝/ap_scan.imageset/ap_scan@3x.png -------------------------------------------------------------------------------- /ZWPullMenuDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ZWPullMenuView.h" 11 | #import "DemoTableMenuCell.h" 12 | @interface ViewController () 13 | 15 | @property (weak, nonatomic) IBOutlet UITableView *mTable; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | [self configNav]; 25 | [self configTable]; 26 | } 27 | #pragma mark - config 28 | - (void)configNav { 29 | self.title = @"下拉菜单"; 30 | UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 31 | [rightBtn setImage:[UIImage imageNamed:@"icon_add_white_20x20"] forState:UIControlStateNormal]; 32 | [rightBtn addTarget:self action:@selector(actionCreateBtn:) forControlEvents:UIControlEventTouchUpInside]; 33 | [rightBtn sizeToFit]; 34 | UIBarButtonItem *rightItemBtn = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; 35 | self.navigationItem.rightBarButtonItems = @[rightItemBtn]; 36 | } 37 | - (void)configTable { 38 | self.mTable.tableFooterView = UIView.new; 39 | [self.mTable registerNib:[UINib nibWithNibName:@"DemoTableMenuCell" bundle:nil] 40 | forCellReuseIdentifier:@"cell"]; 41 | } 42 | #pragma mark - lifeCycle 43 | #pragma mark - delegate 44 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 45 | return 10; 46 | } 47 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 48 | DemoTableMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" 49 | forIndexPath:indexPath]; 50 | return cell; 51 | } 52 | #pragma mark - actionFunction 53 | - (void)actionCreateBtn:(id)sender{ 54 | ZWPullMenuView *menuView = [ZWPullMenuView pullMenuAnchorView:sender titleArray:@[@"2019年02月", 55 | @"2019年01月", 56 | @"2018年12月", 57 | @"2018年11月"]]; 58 | menuView.blockSelectedMenu = ^(NSInteger menuRow) { 59 | NSLog(@"action----->%ld",(long)menuRow); 60 | }; 61 | } 62 | #pragma mark - function 63 | #pragma mark - layzing 64 | - (void)didReceiveMemoryWarning { 65 | [super didReceiveMemoryWarning]; 66 | // Dispose of any resources that can be recreated. 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/example/DemoTableMenuCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTableMenuCell.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2018/4/10. 6 | // Copyright © 2018年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoTableMenuCell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/example/DemoTableMenuCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTableMenuCell.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2018/4/10. 6 | // Copyright © 2018年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "DemoTableMenuCell.h" 10 | #import "ZWPullMenuView.h" 11 | @implementation DemoTableMenuCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | - (IBAction)actionBlueBtn:(id)sender { 18 | ZWPullMenuModel *model1 = [[ZWPullMenuModel alloc] init]; 19 | model1.title = @"编辑"; 20 | ZWPullMenuModel *model2 = [[ZWPullMenuModel alloc] init]; 21 | model2.title = @"删除"; 22 | ZWPullMenuView *menuView = [ZWPullMenuView pullMenuAnchorView:sender menuArray:@[model1,model2]]; 23 | menuView.menuCellHeight = 25; 24 | menuView.zw_adjustPullDown = YES; 25 | } 26 | - (IBAction)actionWechatBtn:(id)sender { 27 | NSArray *titleArray = @[@"发起群聊",@"添加朋友",@"扫一扫",@"收付款"]; 28 | NSArray *imageArray = @[@"contacts_add_newmessage_30x30_", 29 | @"contacts_add_friend_30x30_", 30 | @"contacts_add_scan_30x30_", 31 | @"contacts_add_scan_30x30_"]; 32 | [ZWPullMenuView pullMenuAnchorView:sender 33 | titleArray:titleArray 34 | imageArray:imageArray]; 35 | } 36 | - (IBAction)actionAlipayBtn:(id)sender { 37 | NSArray *titleArray = @[@"发起群聊",@"添加朋友",@"扫一扫",@"收钱"]; 38 | NSArray *imageArray = @[@"ap_group_talk", 39 | @"ap_add_friend", 40 | @"ap_scan", 41 | @"ap_qrcode"]; 42 | ZWPullMenuView *menuView = [ZWPullMenuView pullMenuAnchorView:sender 43 | titleArray:titleArray 44 | imageArray:imageArray]; 45 | menuView.zwPullMenuStyle = PullMenuLightStyle; 46 | } 47 | 48 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 49 | [super setSelected:selected animated:animated]; 50 | 51 | // Configure the view for the selected state 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/example/DemoTableMenuCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 33 | 44 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ZWPullMenuDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ZWPullMenuView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'ZWPullMenuView' 4 | s.version = '0.1.1' 5 | s.summary = '下拉选择视图、支持微信、支付宝等样式。自动计算最优显示位置、动画效果。' 6 | s.homepage = 'https://github.com/wangziwu/ZWPullMenuView' 7 | s.license = 'MIT' 8 | s.authors = {'wangziwu' => 'wang_ziwu@126.com'} 9 | s.platform = :ios,'8.0' 10 | s.ios.deployment_target = '8.0' 11 | s.source = {:git => 'https://github.com/wangziwu/ZWPullMenuView.git',:tag => s.version} 12 | s.source_files = 'ZWPullMenuView/*.{h,m}' 13 | # s.resources = 'ZWPullMenuView/*.{png,xib,nib,bundle}' 14 | s.requires_arc = true 15 | end 16 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuCell.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/30. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ZWPullMenuModel.h" 11 | #import "ZWPullMenuConfig.h" 12 | NS_ASSUME_NONNULL_BEGIN 13 | @interface ZWPullMenuCell : UITableViewCell 14 | @property (strong, nonatomic) UIImageView *menuImageView; 15 | @property (strong, nonatomic) UILabel *menuTitleLab; 16 | /** 17 | * model 18 | */ 19 | @property (nonatomic, strong) ZWPullMenuModel *menuModel; 20 | /** 21 | * 相关配置 22 | */ 23 | @property (nonatomic, strong) ZWPullMenuConfig *zw_menuConfg; 24 | /** 25 | * 线条颜色 26 | */ 27 | @property (nonatomic, strong) UIColor *lineColor; 28 | /** 29 | * 最后一栏cell 30 | */ 31 | @property (nonatomic, assign) BOOL isFinalCell; 32 | /** 33 | * pullMenu样式 34 | */ 35 | @property (nonatomic, assign) ZWPullMenuStyle zwPullMenuStyle; 36 | 37 | @end 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuCell.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/30. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "ZWPullMenuCell.h" 10 | @interface ZWPullMenuCell () 11 | @property (nonatomic, strong) UIView *selectedBgView; 12 | @property (nonatomic, strong) CAShapeLayer *lineLayer; 13 | @end 14 | @implementation ZWPullMenuCell 15 | 16 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 17 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 18 | if (self) { 19 | self.backgroundColor = [UIColor clearColor]; 20 | self.selectedBgView = [[UIView alloc] initWithFrame:self.bounds]; 21 | self.selectedBackgroundView = self.selectedBgView; 22 | [self addSubview:self.menuImageView]; 23 | [self addSubview:self.menuTitleLab]; 24 | } 25 | return self; 26 | } 27 | - (void)layoutSubviews { 28 | [super layoutSubviews]; 29 | } 30 | -(void)setMenuModel:(ZWPullMenuModel *)menuModel{ 31 | _menuModel = menuModel; 32 | if (!menuModel.imageName.length) { 33 | self.menuImageView.hidden = YES; 34 | self.menuTitleLab.frame = CGRectMake(self.zw_menuConfg.zw_menuContentMargin, 0, CGRectGetWidth(self.bounds) - self.zw_menuConfg.zw_menuContentMargin * 2, CGRectGetHeight(self.bounds)); 35 | }else{ 36 | self.menuImageView.hidden = NO; 37 | self.menuImageView.image = [UIImage imageNamed:menuModel.imageName]; 38 | self.menuImageView.frame = CGRectMake(self.zw_menuConfg.zw_menuContentMargin, (CGRectGetHeight(self.bounds) - self.zw_menuConfg.zw_menuImageWidth) * 0.5, self.zw_menuConfg.zw_menuImageWidth, self.zw_menuConfg.zw_menuImageWidth); 39 | self.menuTitleLab.frame = CGRectMake(self.zw_menuConfg.zw_menuContentMargin * 2 + self.zw_menuConfg.zw_menuImageWidth, 0, CGRectGetWidth(self.bounds) - (self.zw_menuConfg.zw_menuContentMargin * 3 + self.zw_menuConfg.zw_menuImageWidth), CGRectGetHeight(self.bounds)); 40 | } 41 | self.menuTitleLab.text = menuModel.title; 42 | self.menuTitleLab.font = [UIFont systemFontOfSize:self.zw_menuConfg.zw_menuTitleFontSize]; 43 | } 44 | -(void)setZwPullMenuStyle:(ZWPullMenuStyle)zwPullMenuStyle{ 45 | _zwPullMenuStyle = zwPullMenuStyle; 46 | switch (zwPullMenuStyle) { 47 | case PullMenuDarkStyle: 48 | { 49 | self.selectedBgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2]; 50 | self.menuTitleLab.textColor = [UIColor whiteColor]; 51 | self.lineColor = [UIColor whiteColor]; 52 | } 53 | break; 54 | case PullMenuLightStyle: 55 | { 56 | self.selectedBgView.backgroundColor = [UIColor groupTableViewBackgroundColor]; 57 | self.menuTitleLab.textColor = [UIColor blackColor]; 58 | self.lineColor = [UIColor lightGrayColor]; 59 | } 60 | break; 61 | default: 62 | break; 63 | } 64 | } 65 | -(void)setIsFinalCell:(BOOL)isFinalCell{ 66 | _isFinalCell = isFinalCell; 67 | if (!isFinalCell) { 68 | [self drawLineSep]; 69 | }else { 70 | [self.lineLayer removeFromSuperlayer]; 71 | } 72 | } 73 | - (void)drawLineSep{ 74 | CAShapeLayer *lineLayer = [CAShapeLayer new]; 75 | lineLayer.strokeColor = self.lineColor.CGColor; 76 | lineLayer.frame = self.bounds; 77 | lineLayer.lineWidth = 0.5; 78 | UIBezierPath *sepline = [UIBezierPath bezierPath]; 79 | [sepline moveToPoint:CGPointMake(self.zw_menuConfg.zw_menuContentMargin, self.bounds.size.height - lineLayer.lineWidth)]; 80 | [sepline addLineToPoint:CGPointMake(self.bounds.size.width - self.zw_menuConfg.zw_menuContentMargin, self.bounds.size.height - lineLayer.lineWidth)]; 81 | lineLayer.path = sepline.CGPath; 82 | [self.layer addSublayer:lineLayer]; 83 | self.lineLayer = lineLayer; 84 | } 85 | - (void)setLineColor:(UIColor *)lineColor{ 86 | if (lineColor) { 87 | _lineColor = lineColor; 88 | } 89 | } 90 | - (UIImageView *)menuImageView { 91 | if (!_menuImageView) { 92 | _menuImageView = [[UIImageView alloc] init]; 93 | } 94 | return _menuImageView; 95 | } 96 | - (UILabel *)menuTitleLab { 97 | if (!_menuTitleLab) { 98 | _menuTitleLab = [[UILabel alloc] init]; 99 | } 100 | return _menuTitleLab; 101 | } 102 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 103 | [super setSelected:selected animated:animated]; 104 | 105 | // Configure the view for the selected state 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuConfig.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2019/2/15. 6 | // Copyright © 2019 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | #define MenuContentMargin 15 //默认文本图片边距 14 | #define MenuImageWidth 30 //默认图片最小尺寸 15 | #define MenuBorderMinMargin 10 //默认下拉框边界围栏 16 | #define MenuTitleFontSize 15 //默认文本字体大小 17 | 18 | @interface ZWPullMenuConfig : NSObject 19 | //文本图片边距 20 | @property (nonatomic, assign) CGFloat zw_menuContentMargin; 21 | //图片最小尺寸 22 | @property (nonatomic, assign) CGFloat zw_menuImageWidth; 23 | //下拉框边界围栏 24 | @property (nonatomic, assign) CGFloat zw_menuBorderMinMargin; 25 | //文本字体大小 26 | @property (nonatomic, assign) CGFloat zw_menuTitleFontSize; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuConfig.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2019/2/15. 6 | // Copyright © 2019 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "ZWPullMenuConfig.h" 10 | 11 | @implementation ZWPullMenuConfig 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuModel.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | NS_ASSUME_NONNULL_BEGIN 11 | typedef NS_ENUM(NSInteger, ZWPullMenuStyle) { 12 | PullMenuDarkStyle = 0, //类微信、黑底白字 13 | PullMenuLightStyle //类支付宝、白底黑字 14 | }; 15 | @interface ZWPullMenuModel : NSObject 16 | /** 17 | * 文字 18 | */ 19 | @property (nonatomic, copy) NSString *title; 20 | /** 21 | * 图片 22 | */ 23 | @property (nonatomic, copy) NSString *imageName; 24 | @end 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuModel.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "ZWPullMenuModel.h" 10 | 11 | @implementation ZWPullMenuModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuView.h 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ZWPullMenuModel.h" 11 | #import "ZWPullMenuConfig.h" 12 | NS_ASSUME_NONNULL_BEGIN 13 | //selected 14 | typedef void(^BlockSelectedMenu)(NSInteger menuRow); 15 | @interface ZWPullMenuView : UIView 16 | /** 17 | * 文字 18 | */ 19 | @property (nonatomic, copy) NSArray *titleArray; 20 | /** 21 | * 图片 22 | */ 23 | @property (nonatomic, copy) NSArray *imageArray; 24 | /** 25 | * 图文Model 26 | */ 27 | @property (nonatomic, copy) NSArray *menuArray; 28 | /** 29 | * 相关配置 30 | */ 31 | @property (nonatomic, strong) ZWPullMenuConfig *zw_menuConfg; 32 | /** 33 | * 蒙层背景color 34 | */ 35 | @property (nonatomic, strong) UIColor *coverBgColor; 36 | /** 37 | * 主样式color 38 | */ 39 | @property (nonatomic, strong) UIColor *menuBgColor; 40 | /** 41 | * 线条颜色 42 | */ 43 | @property (nonatomic, strong) UIColor *lineColor; 44 | /** 45 | * cel高度 46 | */ 47 | @property (nonatomic, assign) CGFloat menuCellHeight; 48 | /** 49 | * table最大高度限制 50 | * 默认:5 * cellHeight 51 | */ 52 | @property (nonatomic, assign) CGFloat menuMaxHeight; 53 | /** 54 | * 小三角高度 55 | * 45°等腰三角形 56 | */ 57 | @property (nonatomic, assign) CGFloat triangleHeight; 58 | /** 59 | * 调整使下拉优先 当向下偏转屏幕距离足够,优先向下偏转 60 | */ 61 | @property (nonatomic, assign) BOOL zw_adjustPullDown; 62 | /** 63 | * pullMenu样式 64 | */ 65 | @property (nonatomic, assign) ZWPullMenuStyle zwPullMenuStyle; 66 | /** 67 | * click 68 | */ 69 | @property (nonatomic, copy) BlockSelectedMenu blockSelectedMenu; 70 | /** 71 | * anchorView:下拉依赖视图[推荐初始化] 72 | * 箭头指向依赖视图 73 | * titleArray:文字 74 | * imageArray:icon 75 | * menuArray:图文Model 76 | */ 77 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView; 78 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView titleArray:(nullable NSArray *)titleArray; 79 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView titleArray:(nullable NSArray *)titleArray imageArray:(nullable NSArray *)imageArray; 80 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView menuArray:(nullable NSArray *)menuArray; 81 | 82 | /** 83 | * anchorView:下拉依赖绝对坐标 84 | * 指定坐标下拉 85 | * 箭头指向点 86 | * titleArray:文字 87 | * imageArray:icon 88 | * menuArray:图文Model 89 | */ 90 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint; 91 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint titleArray:(nullable NSArray *)titleArray; 92 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint titleArray:(nullable NSArray *)titleArray imageArray:(nullable NSArray *)imageArray; 93 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint menuArray:(nullable NSArray *)menuArray; 94 | @end 95 | NS_ASSUME_NONNULL_END 96 | -------------------------------------------------------------------------------- /ZWPullMenuView/ZWPullMenuView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZWPullMenuView.m 3 | // ZWPullMenuDemo 4 | // 5 | // Created by 王子武 on 2017/8/28. 6 | // Copyright © 2017年 wang_ziwu. All rights reserved. 7 | // 8 | 9 | #import "ZWPullMenuView.h" 10 | #import "ZWPullMenuCell.h" 11 | #import "ZWPullMenuModel.h" 12 | 13 | @interface ZWPullMenuView () 14 | 16 | 17 | @property (nonatomic, strong) UIView *contentView; 18 | /** list*/ 19 | @property (nonatomic, strong) UITableView *mTable; 20 | /** rect*/ 21 | @property (nonatomic, assign) CGRect anchorRect; 22 | 23 | @end 24 | @implementation ZWPullMenuView 25 | -(instancetype)init{ 26 | self = [super init]; 27 | if (self) { 28 | [self configUI]; 29 | } 30 | return self; 31 | } 32 | #pragma mark - config 33 | - (void)configUI{ 34 | [self configDefault]; 35 | [self configTable]; 36 | } 37 | - (void)configDefault{ 38 | self.triangleHeight = 8; 39 | self.menuCellHeight = 50; 40 | self.menuMaxHeight = 5 * self.menuCellHeight; 41 | self.zwPullMenuStyle = PullMenuDarkStyle; 42 | } 43 | - (void)configTable{ 44 | [self addSubview:self.contentView]; 45 | [self.mTable registerClass:[ZWPullMenuCell class] 46 | forCellReuseIdentifier:@"ZWPullMenuCell"]; 47 | } 48 | #pragma mark - lifeCycle 49 | #pragma mark - delegate 50 | //tableviewDelegate 51 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 52 | return self.menuArray.count; 53 | } 54 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 55 | return self.menuCellHeight; 56 | } 57 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 58 | ZWPullMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZWPullMenuCell" 59 | forIndexPath:indexPath]; 60 | ZWPullMenuModel *cellModel = self.menuArray[indexPath.row]; 61 | cell.zw_menuConfg = self.zw_menuConfg; 62 | cell.menuModel = cellModel; 63 | cell.zwPullMenuStyle = self.zwPullMenuStyle; 64 | cell.lineColor = self.lineColor; 65 | cell.isFinalCell = indexPath.row == (self.menuArray.count - 1); 66 | return cell; 67 | } 68 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 69 | //取消点击效果 70 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 71 | if (self.blockSelectedMenu) { 72 | self.blockSelectedMenu(indexPath.row); 73 | } 74 | [self animateRemoveView]; 75 | } 76 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 77 | [self animateRemoveView]; 78 | } 79 | #pragma mark - actionFunction 80 | - (void)refreshUI{ 81 | [self.contentView removeFromSuperview]; 82 | self.contentView = nil; 83 | [self addSubview:self.contentView]; 84 | [self drawmTableFrame]; 85 | [self.mTable reloadData]; 86 | } 87 | #pragma mark - function 88 | - (void)animateRemoveView{ 89 | [UIView animateWithDuration:0.5 animations:^{ 90 | self.alpha = 0.f; 91 | self.contentView.transform = CGAffineTransformMakeScale(0.001f, 0.001f); 92 | self.contentView.alpha = 0.f; 93 | } completion:^(BOOL finished) { 94 | [self removeFromSuperview]; 95 | }]; 96 | } 97 | - (CGFloat)cacuateCellWidth{ 98 | __block CGFloat maxTitleWidth = 0; 99 | [self.menuArray enumerateObjectsUsingBlock:^(ZWPullMenuModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 100 | CGFloat width = [obj.title sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:self.zw_menuConfg.zw_menuTitleFontSize]}].width; 101 | if (obj.imageName.length) { 102 | width = width + self.zw_menuConfg.zw_menuContentMargin + self.zw_menuConfg.zw_menuImageWidth; 103 | } 104 | if (width > maxTitleWidth) { 105 | maxTitleWidth = width; 106 | } 107 | }]; 108 | return maxTitleWidth + self.zw_menuConfg.zw_menuContentMargin * 2; 109 | } 110 | - (void)handleMenuModelArray:(NSArray *)array{ 111 | NSMutableArray *tempArray = [NSMutableArray array]; 112 | [array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 113 | ZWPullMenuModel *model = [[ZWPullMenuModel alloc] init]; 114 | model.title = self.titleArray[idx]; 115 | model.imageName = self.imageArray[idx]; 116 | [tempArray addObject:model]; 117 | }]; 118 | self.menuArray = tempArray; 119 | } 120 | #pragma mark - Private 121 | - (void)drawmTableFrame{ 122 | CGPoint layerAnchor = CGPointZero; 123 | CGPoint layerPosition = CGPointZero; 124 | CGFloat x = CGRectGetMidX(self.anchorRect); 125 | CGFloat y = 0; 126 | CGFloat h = self.menuArray.count * self.menuCellHeight; 127 | CGFloat w = [self cacuateCellWidth]; 128 | //最大高度围栏限制 129 | if (h > self.menuMaxHeight) { 130 | h = self.menuMaxHeight; 131 | } 132 | //X中点位置: 133 | //居左:table右偏 134 | //居右:table左偏 135 | if (x > CGRectGetMidX(self.bounds)) { 136 | x = x - 3 * w / 4.f; 137 | layerAnchor.x = 1; 138 | layerPosition.x = x + w; 139 | }else{ 140 | x = x - w / 4.f; 141 | layerAnchor.x = 0; 142 | layerPosition.x = x; 143 | } 144 | //围栏 145 | if (x < self.zw_menuConfg.zw_menuBorderMinMargin) { 146 | x = self.zw_menuConfg.zw_menuBorderMinMargin; 147 | layerPosition.x = x; 148 | } 149 | if (x + w > self.bounds.size.width) { 150 | x = self.bounds.size.width - w - self.zw_menuConfg.zw_menuBorderMinMargin; 151 | layerPosition.x = x + w; 152 | } 153 | //需要偏转Y对比中心点 默认比对屏幕中心点 154 | CGFloat offsetCenterY = CGRectGetMidY(self.bounds); 155 | //优先菜单下拉 156 | if (self.zw_adjustPullDown) { 157 | //下偏移区间距离 158 | offsetCenterY = self.bounds.size.height - h - self.triangleHeight; 159 | } 160 | //Y中心位置 161 | //居上:下拉 162 | //居下:上拉 163 | if (CGRectGetMidY(self.anchorRect) < offsetCenterY) { 164 | y = CGRectGetMaxY(self.anchorRect); 165 | self.mTable.frame = CGRectMake(0, self.triangleHeight, w, h); 166 | layerAnchor.y = 0; 167 | layerPosition.y = y; 168 | }else{ 169 | y = CGRectGetMinY(self.anchorRect) - self.triangleHeight - h; 170 | self.mTable.frame = CGRectMake(0, 0, w, h); 171 | layerAnchor.y = 1; 172 | layerPosition.y = y + h; 173 | } 174 | 175 | self.contentView.frame = CGRectMake(x, y, w, h + self.triangleHeight); 176 | [self drawTriangle]; 177 | //动画锚点 178 | self.contentView.layer.position = layerPosition; 179 | self.contentView.layer.anchorPoint = layerAnchor; 180 | } 181 | //三角形 182 | - (void)drawTriangle{ 183 | CGFloat x = CGRectGetMidX(self.anchorRect) - CGRectGetMinX(self.contentView.frame); 184 | CGFloat y = 0; 185 | CGPoint p = CGPointZero; 186 | CGPoint q = CGPointZero; 187 | CGFloat h = self.menuArray.count * self.menuCellHeight; 188 | //围栏 189 | if (x < 2 * self.triangleHeight) { 190 | x = 2 * self.triangleHeight; 191 | } 192 | if (x > CGRectGetWidth(self.contentView.bounds) - 2 * self.triangleHeight) { 193 | x = CGRectGetWidth(self.contentView.bounds) - 2 * self.triangleHeight; 194 | } 195 | //需要偏转Y对比中心点 默认比对屏幕中心点 196 | CGFloat offsetCenterY = CGRectGetMidY(self.bounds); 197 | //优先菜单下拉 198 | if (self.zw_adjustPullDown) { 199 | //下偏移区间距离 200 | offsetCenterY = self.bounds.size.height - h - self.triangleHeight; 201 | } 202 | //Y中心位置 203 | //居上:下拉 204 | //居下:上拉 205 | if (CGRectGetMidY(self.anchorRect) < offsetCenterY) { 206 | y = 0; 207 | p = CGPointMake(x + self.triangleHeight, y + self.triangleHeight); 208 | q = CGPointMake(x - self.triangleHeight, y + self.triangleHeight); 209 | }else{ 210 | y = CGRectGetHeight(self.contentView.frame); 211 | p = CGPointMake(x + self.triangleHeight, y - self.triangleHeight); 212 | q = CGPointMake(x - self.triangleHeight, y - self.triangleHeight); 213 | } 214 | CAShapeLayer *triangleLayer = [CAShapeLayer new]; 215 | triangleLayer.frame = self.contentView.bounds; 216 | triangleLayer.fillColor = self.menuBgColor.CGColor; 217 | UIBezierPath *bezier = [UIBezierPath bezierPath]; 218 | [bezier moveToPoint:CGPointMake(x, y)]; 219 | [bezier addLineToPoint:p]; 220 | [bezier addLineToPoint:q]; 221 | bezier.lineJoinStyle = kCGLineJoinRound; 222 | triangleLayer.path = bezier.CGPath; 223 | [self.contentView.layer addSublayer:triangleLayer]; 224 | } 225 | #pragma mark - Public 226 | /** 227 | * anchorView:下拉依赖视图[推荐初始化] 228 | * 箭头指向依赖视图 229 | * titleArray:文字 230 | * imageArray:icon 231 | * menuArray:图文Model 232 | */ 233 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView{ 234 | return [self pullMenuAnchorView:anchorView titleArray:nil]; 235 | } 236 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView 237 | titleArray:(NSArray *)titleArray{ 238 | return [self pullMenuAnchorView:anchorView 239 | titleArray:titleArray 240 | imageArray:nil]; 241 | } 242 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView 243 | titleArray:(NSArray *)titleArray 244 | imageArray:(NSArray *)imageArray{ 245 | ZWPullMenuView *menuView = [self pullMenuAnchorView:anchorView menuArray:nil]; 246 | menuView.titleArray = titleArray; 247 | menuView.imageArray = imageArray; 248 | return menuView; 249 | } 250 | + (instancetype)pullMenuAnchorView:(UIView *)anchorView 251 | menuArray:(NSArray *)menuArray{ 252 | UIWindow * window=[[[UIApplication sharedApplication] delegate] window]; 253 | ZWPullMenuView *menuView = [[ZWPullMenuView alloc] init]; 254 | menuView.frame = [UIScreen mainScreen].bounds; 255 | [window addSubview:menuView]; 256 | menuView.anchorRect = [anchorView convertRect:anchorView.bounds 257 | toView:window]; 258 | menuView.menuArray = menuArray; 259 | return menuView; 260 | } 261 | /** 262 | * anchorView:下拉依赖点 263 | * 箭头指向点 264 | * titleArray:文字 265 | * imageArray:icon 266 | * menuArray:图文Model 267 | */ 268 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint{ 269 | return [self pullMenuAnchorPoint:anchorPoint titleArray:nil]; 270 | } 271 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint titleArray:(NSArray *)titleArray{ 272 | return [self pullMenuAnchorPoint:anchorPoint titleArray:titleArray imageArray:nil]; 273 | } 274 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint 275 | titleArray:(NSArray *)titleArray 276 | imageArray:(NSArray *)imageArray{ 277 | ZWPullMenuView *menuView = [self pullMenuAnchorPoint:anchorPoint menuArray:nil]; 278 | menuView.titleArray = titleArray; 279 | menuView.imageArray = imageArray; 280 | return menuView; 281 | } 282 | + (instancetype)pullMenuAnchorPoint:(CGPoint)anchorPoint 283 | menuArray:(NSArray *)menuArray{ 284 | UIWindow * window=[[[UIApplication sharedApplication] delegate] window]; 285 | ZWPullMenuView *menuView = [[ZWPullMenuView alloc] init]; 286 | menuView.frame = [UIScreen mainScreen].bounds; 287 | [window addSubview:menuView]; 288 | menuView.anchorRect = CGRectMake(anchorPoint.x, anchorPoint.y, 0, 0); 289 | menuView.menuArray = menuArray; 290 | return menuView; 291 | } 292 | 293 | #pragma mark - layzing 294 | - (UITableView *)mTable{ 295 | if (!_mTable) { 296 | _mTable = [[UITableView alloc] initWithFrame:CGRectZero 297 | style:UITableViewStylePlain]; 298 | _mTable.delegate = self; 299 | _mTable.dataSource = self; 300 | _mTable.layer.cornerRadius = 5; 301 | _mTable.backgroundColor = self.menuBgColor; 302 | _mTable.separatorStyle = UITableViewCellSeparatorStyleNone; 303 | } 304 | return _mTable; 305 | } 306 | - (UIView *)contentView{ 307 | if (!_contentView) { 308 | _contentView = [[UIView alloc] initWithFrame:CGRectZero]; 309 | [_contentView addSubview:self.mTable]; 310 | } 311 | return _contentView; 312 | } 313 | - (ZWPullMenuConfig *)zw_menuConfg { 314 | if (!_zw_menuConfg) { 315 | _zw_menuConfg = [[ZWPullMenuConfig alloc] init]; 316 | _zw_menuConfg.zw_menuContentMargin = MenuContentMargin; 317 | _zw_menuConfg.zw_menuImageWidth = MenuImageWidth; 318 | _zw_menuConfg.zw_menuBorderMinMargin = MenuBorderMinMargin; 319 | _zw_menuConfg.zw_menuTitleFontSize = MenuTitleFontSize; 320 | } 321 | return _zw_menuConfg; 322 | } 323 | -(void)setMenuArray:(NSArray *)menuArray{ 324 | _menuArray = menuArray; 325 | [self refreshUI]; 326 | } 327 | -(void)setTitleArray:(NSArray *)titleArray{ 328 | _titleArray = titleArray; 329 | if (!titleArray.count) return; 330 | if (self.menuArray.count&& 331 | self.menuArray.count != titleArray.count) { 332 | NSLog( @"文字图片数量不匹配!"); 333 | return; 334 | } 335 | [self handleMenuModelArray:titleArray]; 336 | } 337 | -(void)setImageArray:(NSArray *)imageArray{ 338 | _imageArray = imageArray; 339 | if (!imageArray.count) return; 340 | if (self.menuArray.count&& 341 | self.menuArray.count != imageArray.count) { 342 | NSLog( @"文字图片数量不匹配!"); 343 | return; 344 | } 345 | [self handleMenuModelArray:imageArray]; 346 | } 347 | -(void)setZwPullMenuStyle:(ZWPullMenuStyle)zwPullMenuStyle{ 348 | _zwPullMenuStyle = zwPullMenuStyle; 349 | switch (zwPullMenuStyle) { 350 | case PullMenuDarkStyle: 351 | { 352 | self.coverBgColor = [UIColor clearColor]; 353 | self.menuBgColor = [[UIColor blackColor] colorWithAlphaComponent:0.6]; 354 | } 355 | break; 356 | case PullMenuLightStyle: 357 | { 358 | self.coverBgColor = [[UIColor grayColor] colorWithAlphaComponent:0.3]; 359 | self.menuBgColor = [UIColor whiteColor]; 360 | } 361 | break; 362 | default: 363 | break; 364 | } 365 | } 366 | - (void)setCoverBgColor:(UIColor *)coverBgColor{ 367 | _coverBgColor = coverBgColor; 368 | self.backgroundColor = self.coverBgColor; 369 | } 370 | - (void)setMenuBgColor:(UIColor *)menuBgColor{ 371 | _menuBgColor = menuBgColor; 372 | self.mTable.backgroundColor = self.menuBgColor; 373 | [self refreshUI]; 374 | } 375 | -(void)setAnchorRect:(CGRect)anchorRect{ 376 | _anchorRect = anchorRect; 377 | } 378 | - (void)setLineColor:(UIColor *)lineColor { 379 | _lineColor = lineColor; 380 | [self refreshUI]; 381 | } 382 | - (void)setMenuCellHeight:(CGFloat)menuCellHeight { 383 | _menuCellHeight = menuCellHeight; 384 | [self refreshUI]; 385 | } 386 | - (void)setZw_adjustPullDown:(BOOL)zw_adjustPullDown { 387 | _zw_adjustPullDown = zw_adjustPullDown; 388 | [self refreshUI]; 389 | } 390 | /* 391 | // Only override drawRect: if you perform custom drawing. 392 | // An empty implementation adversely affects performance during animation. 393 | - (void)drawRect:(CGRect)rect { 394 | // Drawing code 395 | } 396 | */ 397 | 398 | @end 399 | --------------------------------------------------------------------------------