├── PopMenuTableView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── kongfanwu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── kongfanwu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── PopMenuTableView.xcscheme │ └── xcschememanagement.plist ├── PopMenuTableView ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── home2.imageset │ │ ├── Contents.json │ │ └── home2.png │ ├── icon_button_affirm.imageset │ │ ├── Contents.json │ │ ├── icon_button_affirm@2x.png │ │ └── icon_button_affirm@3x.png │ ├── icon_button_recall.imageset │ │ ├── Contents.json │ │ ├── icon_button_recall@2x.png │ │ └── icon_button_recall@3x.png │ ├── icon_button_record.imageset │ │ ├── Contents.json │ │ ├── icon_button_record@2x.png │ │ └── icon_button_record@3x.png │ └── pop_black_backGround.imageset │ │ ├── Contents.json │ │ ├── pop_black_backGround@2x.png │ │ └── pop_black_backGround@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── Menu │ ├── CommonMenuView.h │ ├── CommonMenuView.m │ ├── MenuModel.h │ ├── MenuModel.m │ ├── MenuTableViewCell.h │ ├── MenuTableViewCell.m │ ├── UIView+AdjustFrame.h │ └── UIView+AdjustFrame.m ├── ViewController.h ├── ViewController.m └── main.m ├── PopMenuTableViewTests ├── Info.plist └── PopMenuTableViewTests.m ├── PopMenuTableViewUITests ├── Info.plist └── PopMenuTableViewUITests.m ├── README.md └── 代码示例 /PopMenuTableView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4BA71DE91D4F4D8A00460775 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA71DE81D4F4D8A00460775 /* main.m */; }; 11 | 4BA71DEC1D4F4D8A00460775 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA71DEB1D4F4D8A00460775 /* AppDelegate.m */; }; 12 | 4BA71DEF1D4F4D8A00460775 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA71DEE1D4F4D8A00460775 /* ViewController.m */; }; 13 | 4BA71DF21D4F4D8A00460775 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BA71DF01D4F4D8A00460775 /* Main.storyboard */; }; 14 | 4BA71DF41D4F4D8A00460775 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4BA71DF31D4F4D8A00460775 /* Assets.xcassets */; }; 15 | 4BA71DF71D4F4D8A00460775 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BA71DF51D4F4D8A00460775 /* LaunchScreen.storyboard */; }; 16 | 4BA71E021D4F4D8A00460775 /* PopMenuTableViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA71E011D4F4D8A00460775 /* PopMenuTableViewTests.m */; }; 17 | 4BA71E0D1D4F4D8A00460775 /* PopMenuTableViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA71E0C1D4F4D8A00460775 /* PopMenuTableViewUITests.m */; }; 18 | 4BAB7E251F95CA1D006604EF /* CommonMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BAB7E1E1F95CA1D006604EF /* CommonMenuView.m */; }; 19 | 4BAB7E261F95CA1D006604EF /* MenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BAB7E201F95CA1D006604EF /* MenuModel.m */; }; 20 | 4BAB7E271F95CA1D006604EF /* MenuTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BAB7E221F95CA1D006604EF /* MenuTableViewCell.m */; }; 21 | 4BAB7E281F95CA1D006604EF /* UIView+AdjustFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BAB7E241F95CA1D006604EF /* UIView+AdjustFrame.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 4BA71DFE1D4F4D8A00460775 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 4BA71DDC1D4F4D8A00460775 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 4BA71DE31D4F4D8A00460775; 30 | remoteInfo = PopMenuTableView; 31 | }; 32 | 4BA71E091D4F4D8A00460775 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 4BA71DDC1D4F4D8A00460775 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 4BA71DE31D4F4D8A00460775; 37 | remoteInfo = PopMenuTableView; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 4BA71DE41D4F4D8A00460775 /* PopMenuTableView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PopMenuTableView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 4BA71DE81D4F4D8A00460775 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 4BA71DEA1D4F4D8A00460775 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 4BA71DEB1D4F4D8A00460775 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 4BA71DED1D4F4D8A00460775 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 47 | 4BA71DEE1D4F4D8A00460775 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 48 | 4BA71DF11D4F4D8A00460775 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 4BA71DF31D4F4D8A00460775 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 4BA71DF61D4F4D8A00460775 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 4BA71DF81D4F4D8A00460775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 4BA71DFD1D4F4D8A00460775 /* PopMenuTableViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PopMenuTableViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 4BA71E011D4F4D8A00460775 /* PopMenuTableViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PopMenuTableViewTests.m; sourceTree = ""; }; 54 | 4BA71E031D4F4D8A00460775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 4BA71E081D4F4D8A00460775 /* PopMenuTableViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PopMenuTableViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 4BA71E0C1D4F4D8A00460775 /* PopMenuTableViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PopMenuTableViewUITests.m; sourceTree = ""; }; 57 | 4BA71E0E1D4F4D8A00460775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 4BAB7E1D1F95CA1D006604EF /* CommonMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonMenuView.h; sourceTree = ""; }; 59 | 4BAB7E1E1F95CA1D006604EF /* CommonMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonMenuView.m; sourceTree = ""; }; 60 | 4BAB7E1F1F95CA1D006604EF /* MenuModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuModel.h; sourceTree = ""; }; 61 | 4BAB7E201F95CA1D006604EF /* MenuModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuModel.m; sourceTree = ""; }; 62 | 4BAB7E211F95CA1D006604EF /* MenuTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewCell.h; sourceTree = ""; }; 63 | 4BAB7E221F95CA1D006604EF /* MenuTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewCell.m; sourceTree = ""; }; 64 | 4BAB7E231F95CA1D006604EF /* UIView+AdjustFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+AdjustFrame.h"; sourceTree = ""; }; 65 | 4BAB7E241F95CA1D006604EF /* UIView+AdjustFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+AdjustFrame.m"; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 4BA71DE11D4F4D8A00460775 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 4BA71DFA1D4F4D8A00460775 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 4BA71E051D4F4D8A00460775 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 4BA71DDB1D4F4D8A00460775 = { 94 | isa = PBXGroup; 95 | children = ( 96 | 4BA71DE61D4F4D8A00460775 /* PopMenuTableView */, 97 | 4BA71E001D4F4D8A00460775 /* PopMenuTableViewTests */, 98 | 4BA71E0B1D4F4D8A00460775 /* PopMenuTableViewUITests */, 99 | 4BA71DE51D4F4D8A00460775 /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | 4BA71DE51D4F4D8A00460775 /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 4BA71DE41D4F4D8A00460775 /* PopMenuTableView.app */, 107 | 4BA71DFD1D4F4D8A00460775 /* PopMenuTableViewTests.xctest */, 108 | 4BA71E081D4F4D8A00460775 /* PopMenuTableViewUITests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 4BA71DE61D4F4D8A00460775 /* PopMenuTableView */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 4BAB7E1C1F95CA1D006604EF /* Menu */, 117 | 4BA71DEA1D4F4D8A00460775 /* AppDelegate.h */, 118 | 4BA71DEB1D4F4D8A00460775 /* AppDelegate.m */, 119 | 4BA71DED1D4F4D8A00460775 /* ViewController.h */, 120 | 4BA71DEE1D4F4D8A00460775 /* ViewController.m */, 121 | 4BA71DF01D4F4D8A00460775 /* Main.storyboard */, 122 | 4BA71DF31D4F4D8A00460775 /* Assets.xcassets */, 123 | 4BA71DF51D4F4D8A00460775 /* LaunchScreen.storyboard */, 124 | 4BA71DF81D4F4D8A00460775 /* Info.plist */, 125 | 4BA71DE71D4F4D8A00460775 /* Supporting Files */, 126 | ); 127 | path = PopMenuTableView; 128 | sourceTree = ""; 129 | }; 130 | 4BA71DE71D4F4D8A00460775 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 4BA71DE81D4F4D8A00460775 /* main.m */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | 4BA71E001D4F4D8A00460775 /* PopMenuTableViewTests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 4BA71E011D4F4D8A00460775 /* PopMenuTableViewTests.m */, 142 | 4BA71E031D4F4D8A00460775 /* Info.plist */, 143 | ); 144 | path = PopMenuTableViewTests; 145 | sourceTree = ""; 146 | }; 147 | 4BA71E0B1D4F4D8A00460775 /* PopMenuTableViewUITests */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 4BA71E0C1D4F4D8A00460775 /* PopMenuTableViewUITests.m */, 151 | 4BA71E0E1D4F4D8A00460775 /* Info.plist */, 152 | ); 153 | path = PopMenuTableViewUITests; 154 | sourceTree = ""; 155 | }; 156 | 4BAB7E1C1F95CA1D006604EF /* Menu */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 4BAB7E1D1F95CA1D006604EF /* CommonMenuView.h */, 160 | 4BAB7E1E1F95CA1D006604EF /* CommonMenuView.m */, 161 | 4BAB7E1F1F95CA1D006604EF /* MenuModel.h */, 162 | 4BAB7E201F95CA1D006604EF /* MenuModel.m */, 163 | 4BAB7E211F95CA1D006604EF /* MenuTableViewCell.h */, 164 | 4BAB7E221F95CA1D006604EF /* MenuTableViewCell.m */, 165 | 4BAB7E231F95CA1D006604EF /* UIView+AdjustFrame.h */, 166 | 4BAB7E241F95CA1D006604EF /* UIView+AdjustFrame.m */, 167 | ); 168 | path = Menu; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 4BA71DE31D4F4D8A00460775 /* PopMenuTableView */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 4BA71E111D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableView" */; 177 | buildPhases = ( 178 | 4BA71DE01D4F4D8A00460775 /* Sources */, 179 | 4BA71DE11D4F4D8A00460775 /* Frameworks */, 180 | 4BA71DE21D4F4D8A00460775 /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = PopMenuTableView; 187 | productName = PopMenuTableView; 188 | productReference = 4BA71DE41D4F4D8A00460775 /* PopMenuTableView.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | 4BA71DFC1D4F4D8A00460775 /* PopMenuTableViewTests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 4BA71E141D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableViewTests" */; 194 | buildPhases = ( 195 | 4BA71DF91D4F4D8A00460775 /* Sources */, 196 | 4BA71DFA1D4F4D8A00460775 /* Frameworks */, 197 | 4BA71DFB1D4F4D8A00460775 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 4BA71DFF1D4F4D8A00460775 /* PBXTargetDependency */, 203 | ); 204 | name = PopMenuTableViewTests; 205 | productName = PopMenuTableViewTests; 206 | productReference = 4BA71DFD1D4F4D8A00460775 /* PopMenuTableViewTests.xctest */; 207 | productType = "com.apple.product-type.bundle.unit-test"; 208 | }; 209 | 4BA71E071D4F4D8A00460775 /* PopMenuTableViewUITests */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = 4BA71E171D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableViewUITests" */; 212 | buildPhases = ( 213 | 4BA71E041D4F4D8A00460775 /* Sources */, 214 | 4BA71E051D4F4D8A00460775 /* Frameworks */, 215 | 4BA71E061D4F4D8A00460775 /* Resources */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | 4BA71E0A1D4F4D8A00460775 /* PBXTargetDependency */, 221 | ); 222 | name = PopMenuTableViewUITests; 223 | productName = PopMenuTableViewUITests; 224 | productReference = 4BA71E081D4F4D8A00460775 /* PopMenuTableViewUITests.xctest */; 225 | productType = "com.apple.product-type.bundle.ui-testing"; 226 | }; 227 | /* End PBXNativeTarget section */ 228 | 229 | /* Begin PBXProject section */ 230 | 4BA71DDC1D4F4D8A00460775 /* Project object */ = { 231 | isa = PBXProject; 232 | attributes = { 233 | LastUpgradeCheck = 0730; 234 | ORGANIZATIONNAME = KongPro; 235 | TargetAttributes = { 236 | 4BA71DE31D4F4D8A00460775 = { 237 | CreatedOnToolsVersion = 7.3; 238 | }; 239 | 4BA71DFC1D4F4D8A00460775 = { 240 | CreatedOnToolsVersion = 7.3; 241 | TestTargetID = 4BA71DE31D4F4D8A00460775; 242 | }; 243 | 4BA71E071D4F4D8A00460775 = { 244 | CreatedOnToolsVersion = 7.3; 245 | TestTargetID = 4BA71DE31D4F4D8A00460775; 246 | }; 247 | }; 248 | }; 249 | buildConfigurationList = 4BA71DDF1D4F4D8A00460775 /* Build configuration list for PBXProject "PopMenuTableView" */; 250 | compatibilityVersion = "Xcode 3.2"; 251 | developmentRegion = English; 252 | hasScannedForEncodings = 0; 253 | knownRegions = ( 254 | en, 255 | Base, 256 | ); 257 | mainGroup = 4BA71DDB1D4F4D8A00460775; 258 | productRefGroup = 4BA71DE51D4F4D8A00460775 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | 4BA71DE31D4F4D8A00460775 /* PopMenuTableView */, 263 | 4BA71DFC1D4F4D8A00460775 /* PopMenuTableViewTests */, 264 | 4BA71E071D4F4D8A00460775 /* PopMenuTableViewUITests */, 265 | ); 266 | }; 267 | /* End PBXProject section */ 268 | 269 | /* Begin PBXResourcesBuildPhase section */ 270 | 4BA71DE21D4F4D8A00460775 /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 4BA71DF71D4F4D8A00460775 /* LaunchScreen.storyboard in Resources */, 275 | 4BA71DF41D4F4D8A00460775 /* Assets.xcassets in Resources */, 276 | 4BA71DF21D4F4D8A00460775 /* Main.storyboard in Resources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | 4BA71DFB1D4F4D8A00460775 /* Resources */ = { 281 | isa = PBXResourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | 4BA71E061D4F4D8A00460775 /* Resources */ = { 288 | isa = PBXResourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | /* End PBXResourcesBuildPhase section */ 295 | 296 | /* Begin PBXSourcesBuildPhase section */ 297 | 4BA71DE01D4F4D8A00460775 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 4BAB7E251F95CA1D006604EF /* CommonMenuView.m in Sources */, 302 | 4BAB7E281F95CA1D006604EF /* UIView+AdjustFrame.m in Sources */, 303 | 4BA71DEF1D4F4D8A00460775 /* ViewController.m in Sources */, 304 | 4BAB7E261F95CA1D006604EF /* MenuModel.m in Sources */, 305 | 4BA71DEC1D4F4D8A00460775 /* AppDelegate.m in Sources */, 306 | 4BAB7E271F95CA1D006604EF /* MenuTableViewCell.m in Sources */, 307 | 4BA71DE91D4F4D8A00460775 /* main.m in Sources */, 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | }; 311 | 4BA71DF91D4F4D8A00460775 /* Sources */ = { 312 | isa = PBXSourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | 4BA71E021D4F4D8A00460775 /* PopMenuTableViewTests.m in Sources */, 316 | ); 317 | runOnlyForDeploymentPostprocessing = 0; 318 | }; 319 | 4BA71E041D4F4D8A00460775 /* Sources */ = { 320 | isa = PBXSourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | 4BA71E0D1D4F4D8A00460775 /* PopMenuTableViewUITests.m in Sources */, 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | }; 327 | /* End PBXSourcesBuildPhase section */ 328 | 329 | /* Begin PBXTargetDependency section */ 330 | 4BA71DFF1D4F4D8A00460775 /* PBXTargetDependency */ = { 331 | isa = PBXTargetDependency; 332 | target = 4BA71DE31D4F4D8A00460775 /* PopMenuTableView */; 333 | targetProxy = 4BA71DFE1D4F4D8A00460775 /* PBXContainerItemProxy */; 334 | }; 335 | 4BA71E0A1D4F4D8A00460775 /* PBXTargetDependency */ = { 336 | isa = PBXTargetDependency; 337 | target = 4BA71DE31D4F4D8A00460775 /* PopMenuTableView */; 338 | targetProxy = 4BA71E091D4F4D8A00460775 /* PBXContainerItemProxy */; 339 | }; 340 | /* End PBXTargetDependency section */ 341 | 342 | /* Begin PBXVariantGroup section */ 343 | 4BA71DF01D4F4D8A00460775 /* Main.storyboard */ = { 344 | isa = PBXVariantGroup; 345 | children = ( 346 | 4BA71DF11D4F4D8A00460775 /* Base */, 347 | ); 348 | name = Main.storyboard; 349 | sourceTree = ""; 350 | }; 351 | 4BA71DF51D4F4D8A00460775 /* LaunchScreen.storyboard */ = { 352 | isa = PBXVariantGroup; 353 | children = ( 354 | 4BA71DF61D4F4D8A00460775 /* Base */, 355 | ); 356 | name = LaunchScreen.storyboard; 357 | sourceTree = ""; 358 | }; 359 | /* End PBXVariantGroup section */ 360 | 361 | /* Begin XCBuildConfiguration section */ 362 | 4BA71E0F1D4F4D8A00460775 /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ALWAYS_SEARCH_USER_PATHS = NO; 366 | CLANG_ANALYZER_NONNULL = YES; 367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 368 | CLANG_CXX_LIBRARY = "libc++"; 369 | CLANG_ENABLE_MODULES = YES; 370 | CLANG_ENABLE_OBJC_ARC = YES; 371 | CLANG_WARN_BOOL_CONVERSION = YES; 372 | CLANG_WARN_CONSTANT_CONVERSION = YES; 373 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 374 | CLANG_WARN_EMPTY_BODY = YES; 375 | CLANG_WARN_ENUM_CONVERSION = YES; 376 | CLANG_WARN_INT_CONVERSION = YES; 377 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 378 | CLANG_WARN_UNREACHABLE_CODE = YES; 379 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 381 | COPY_PHASE_STRIP = NO; 382 | DEBUG_INFORMATION_FORMAT = dwarf; 383 | ENABLE_STRICT_OBJC_MSGSEND = YES; 384 | ENABLE_TESTABILITY = YES; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_DYNAMIC_NO_PIC = NO; 387 | GCC_NO_COMMON_BLOCKS = YES; 388 | GCC_OPTIMIZATION_LEVEL = 0; 389 | GCC_PREPROCESSOR_DEFINITIONS = ( 390 | "DEBUG=1", 391 | "$(inherited)", 392 | ); 393 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 394 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 395 | GCC_WARN_UNDECLARED_SELECTOR = YES; 396 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 397 | GCC_WARN_UNUSED_FUNCTION = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 400 | MTL_ENABLE_DEBUG_INFO = YES; 401 | ONLY_ACTIVE_ARCH = YES; 402 | SDKROOT = iphoneos; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | }; 405 | name = Debug; 406 | }; 407 | 4BA71E101D4F4D8A00460775 /* Release */ = { 408 | isa = XCBuildConfiguration; 409 | buildSettings = { 410 | ALWAYS_SEARCH_USER_PATHS = NO; 411 | CLANG_ANALYZER_NONNULL = YES; 412 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 413 | CLANG_CXX_LIBRARY = "libc++"; 414 | CLANG_ENABLE_MODULES = YES; 415 | CLANG_ENABLE_OBJC_ARC = YES; 416 | CLANG_WARN_BOOL_CONVERSION = YES; 417 | CLANG_WARN_CONSTANT_CONVERSION = YES; 418 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 419 | CLANG_WARN_EMPTY_BODY = YES; 420 | CLANG_WARN_ENUM_CONVERSION = YES; 421 | CLANG_WARN_INT_CONVERSION = YES; 422 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 423 | CLANG_WARN_UNREACHABLE_CODE = YES; 424 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 425 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 426 | COPY_PHASE_STRIP = NO; 427 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 428 | ENABLE_NS_ASSERTIONS = NO; 429 | ENABLE_STRICT_OBJC_MSGSEND = YES; 430 | GCC_C_LANGUAGE_STANDARD = gnu99; 431 | GCC_NO_COMMON_BLOCKS = YES; 432 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 433 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 434 | GCC_WARN_UNDECLARED_SELECTOR = YES; 435 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 436 | GCC_WARN_UNUSED_FUNCTION = YES; 437 | GCC_WARN_UNUSED_VARIABLE = YES; 438 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 439 | MTL_ENABLE_DEBUG_INFO = NO; 440 | SDKROOT = iphoneos; 441 | TARGETED_DEVICE_FAMILY = "1,2"; 442 | VALIDATE_PRODUCT = YES; 443 | }; 444 | name = Release; 445 | }; 446 | 4BA71E121D4F4D8A00460775 /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | buildSettings = { 449 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 450 | INFOPLIST_FILE = PopMenuTableView/Info.plist; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 452 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableView; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | }; 455 | name = Debug; 456 | }; 457 | 4BA71E131D4F4D8A00460775 /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | INFOPLIST_FILE = PopMenuTableView/Info.plist; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 463 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableView; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | }; 466 | name = Release; 467 | }; 468 | 4BA71E151D4F4D8A00460775 /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | BUNDLE_LOADER = "$(TEST_HOST)"; 472 | INFOPLIST_FILE = PopMenuTableViewTests/Info.plist; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 474 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableViewTests; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopMenuTableView.app/PopMenuTableView"; 477 | }; 478 | name = Debug; 479 | }; 480 | 4BA71E161D4F4D8A00460775 /* Release */ = { 481 | isa = XCBuildConfiguration; 482 | buildSettings = { 483 | BUNDLE_LOADER = "$(TEST_HOST)"; 484 | INFOPLIST_FILE = PopMenuTableViewTests/Info.plist; 485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 486 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableViewTests; 487 | PRODUCT_NAME = "$(TARGET_NAME)"; 488 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopMenuTableView.app/PopMenuTableView"; 489 | }; 490 | name = Release; 491 | }; 492 | 4BA71E181D4F4D8A00460775 /* Debug */ = { 493 | isa = XCBuildConfiguration; 494 | buildSettings = { 495 | INFOPLIST_FILE = PopMenuTableViewUITests/Info.plist; 496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 497 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableViewUITests; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | TEST_TARGET_NAME = PopMenuTableView; 500 | }; 501 | name = Debug; 502 | }; 503 | 4BA71E191D4F4D8A00460775 /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | INFOPLIST_FILE = PopMenuTableViewUITests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = KongPro.PopMenuTableViewUITests; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TEST_TARGET_NAME = PopMenuTableView; 511 | }; 512 | name = Release; 513 | }; 514 | /* End XCBuildConfiguration section */ 515 | 516 | /* Begin XCConfigurationList section */ 517 | 4BA71DDF1D4F4D8A00460775 /* Build configuration list for PBXProject "PopMenuTableView" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 4BA71E0F1D4F4D8A00460775 /* Debug */, 521 | 4BA71E101D4F4D8A00460775 /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | 4BA71E111D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableView" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | 4BA71E121D4F4D8A00460775 /* Debug */, 530 | 4BA71E131D4F4D8A00460775 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | defaultConfigurationName = Release; 534 | }; 535 | 4BA71E141D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableViewTests" */ = { 536 | isa = XCConfigurationList; 537 | buildConfigurations = ( 538 | 4BA71E151D4F4D8A00460775 /* Debug */, 539 | 4BA71E161D4F4D8A00460775 /* Release */, 540 | ); 541 | defaultConfigurationIsVisible = 0; 542 | defaultConfigurationName = Release; 543 | }; 544 | 4BA71E171D4F4D8A00460775 /* Build configuration list for PBXNativeTarget "PopMenuTableViewUITests" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 4BA71E181D4F4D8A00460775 /* Debug */, 548 | 4BA71E191D4F4D8A00460775 /* Release */, 549 | ); 550 | defaultConfigurationIsVisible = 0; 551 | defaultConfigurationName = Release; 552 | }; 553 | /* End XCConfigurationList section */ 554 | }; 555 | rootObject = 4BA71DDC1D4F4D8A00460775 /* Project object */; 556 | } 557 | -------------------------------------------------------------------------------- /PopMenuTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PopMenuTableView.xcodeproj/project.xcworkspace/xcuserdata/kongfanwu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView.xcodeproj/project.xcworkspace/xcuserdata/kongfanwu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PopMenuTableView.xcodeproj/xcuserdata/kongfanwu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /PopMenuTableView.xcodeproj/xcuserdata/kongfanwu.xcuserdatad/xcschemes/PopMenuTableView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /PopMenuTableView.xcodeproj/xcuserdata/kongfanwu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PopMenuTableView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4BA71DE31D4F4D8A00460775 16 | 17 | primary 18 | 19 | 20 | 4BA71DFC1D4F4D8A00460775 21 | 22 | primary 23 | 24 | 25 | 4BA71E071D4F4D8A00460775 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PopMenuTableView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 KongPro. 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 | -------------------------------------------------------------------------------- /PopMenuTableView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 KongPro. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PopMenuTableView/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 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/home2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home2.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/home2.imageset/home2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/home2.imageset/home2.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_affirm.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_button_affirm@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_button_affirm@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_affirm.imageset/icon_button_affirm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_affirm.imageset/icon_button_affirm@2x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_affirm.imageset/icon_button_affirm@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_affirm.imageset/icon_button_affirm@3x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_recall.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_button_recall@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_button_recall@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_recall.imageset/icon_button_recall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_recall.imageset/icon_button_recall@2x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_recall.imageset/icon_button_recall@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_recall.imageset/icon_button_recall@3x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_record.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_button_record@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_button_record@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_record.imageset/icon_button_record@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_record.imageset/icon_button_record@2x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/icon_button_record.imageset/icon_button_record@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/icon_button_record.imageset/icon_button_record@3x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/pop_black_backGround.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "resizing" : { 9 | "mode" : "9-part", 10 | "center" : { 11 | "mode" : "tile", 12 | "width" : 2, 13 | "height" : 29 14 | }, 15 | "cap-insets" : { 16 | "bottom" : 37, 17 | "top" : 30, 18 | "right" : 73, 19 | "left" : 34 20 | } 21 | }, 22 | "idiom" : "universal", 23 | "filename" : "pop_black_backGround@2x.png", 24 | "scale" : "2x" 25 | }, 26 | { 27 | "resizing" : { 28 | "mode" : "9-part", 29 | "center" : { 30 | "mode" : "tile", 31 | "width" : 1, 32 | "height" : 29 33 | }, 34 | "cap-insets" : { 35 | "bottom" : 49, 36 | "top" : 45, 37 | "right" : 117, 38 | "left" : 67 39 | } 40 | }, 41 | "idiom" : "universal", 42 | "filename" : "pop_black_backGround@3x.png", 43 | "scale" : "3x" 44 | } 45 | ], 46 | "info" : { 47 | "version" : 1, 48 | "author" : "xcode" 49 | } 50 | } -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/pop_black_backGround.imageset/pop_black_backGround@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/pop_black_backGround.imageset/pop_black_backGround@2x.png -------------------------------------------------------------------------------- /PopMenuTableView/Assets.xcassets/pop_black_backGround.imageset/pop_black_backGround@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KongPro/PopMenuTableView/70bc046f20079fe56569ca06ca5e978a00251a1b/PopMenuTableView/Assets.xcassets/pop_black_backGround.imageset/pop_black_backGround@3x.png -------------------------------------------------------------------------------- /PopMenuTableView/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 | -------------------------------------------------------------------------------- /PopMenuTableView/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 | 35 | 43 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /PopMenuTableView/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/CommonMenuView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommonMenuView.h 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 2016/12/1. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void(^ItemsClickBlock)(NSString *str, NSInteger tag); 11 | typedef void(^BackViewTapBlock)(); 12 | 13 | @interface CommonMenuView : UIView 14 | /* 菜单点击回掉,默认值:6; */ 15 | @property (nonatomic,copy) ItemsClickBlock itemsClickBlock; 16 | 17 | @property (nonatomic,copy) BackViewTapBlock backViewTapBlock; 18 | /* 最多菜单项个数,默认值:6; */ 19 | @property (nonatomic,assign) NSInteger maxValueForItemCount; 20 | 21 | /** 22 | * menu 23 | * 24 | * @param frame 菜单frame 25 | * @param target 将在在何控制器弹出 26 | * @param dataArray 菜单项内容 27 | * @param itemsClickBlock 点击某个菜单项的blick 28 | * @param backViewTapBlock 点击背景遮罩的block 29 | * 30 | * @return 返回创建对象 31 | */ 32 | + (CommonMenuView *)createMenuWithFrame:(CGRect)frame target:(UIViewController *)target dataArray:(NSArray *)dataArray itemsClickBlock:(void(^)(NSString *str, NSInteger tag))itemsClickBlock backViewTap:(void(^)())backViewTapBlock; 33 | 34 | /** 35 | * 展示菜单,定点展示 36 | * 37 | * @param point 展示坐标 38 | */ 39 | + (void)showMenuAtPoint:(CGPoint)point; 40 | 41 | /* 隐藏菜单 */ 42 | + (void)hidden; 43 | 44 | /* 移除菜单 */ 45 | + (void)clearMenu; 46 | 47 | /** 48 | * 追加菜单项 49 | * 50 | * @param itemsArray 需要追加的菜单项内容数组 51 | */ 52 | + (void)appendMenuItemsWith:(NSArray *)appendItemsArray; 53 | 54 | /** 55 | * 更新菜单项 56 | * 57 | * @param itemsArray 需要更新的菜单项内容数组 58 | */ 59 | + (void)updateMenuItemsWith:(NSArray *)newItemsArray; 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/CommonMenuView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommonMenuView.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 2016/12/1. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import "CommonMenuView.h" 10 | #import "UIView+AdjustFrame.h" 11 | #import "MenuModel.h" 12 | #import "MenuTableViewCell.h" 13 | 14 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 15 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 16 | #define kMenuTag 201712 17 | #define kCoverViewTag 201722 18 | #define kMargin 8 19 | #define kTriangleHeight 10 // 三角形的高 20 | #define kRadius 5 // 圆角半径 21 | #define KDefaultMaxValue 6 // 菜单项最大值 22 | 23 | @interface CommonMenuView () 24 | @property (nonatomic,strong) CommonMenuView * selfMenu; 25 | @property (nonatomic,strong) UITableView * contentTableView;; 26 | @property (nonatomic,strong) NSMutableArray * menuDataArray; 27 | @end 28 | 29 | @implementation CommonMenuView { 30 | UIView *_backView; 31 | CGFloat arrowPointX; // 箭头位置 32 | } 33 | 34 | - (void)setMenuDataArray:(NSMutableArray *)menuDataArray{ 35 | if (!_menuDataArray) { 36 | _menuDataArray = [NSMutableArray array]; 37 | } 38 | [menuDataArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 39 | if (![obj isKindOfClass:[MenuModel class]]) { 40 | MenuModel *model = [MenuModel MenuModelWithDict:(NSDictionary *)obj]; 41 | [_menuDataArray addObject:model]; 42 | } 43 | }]; 44 | } 45 | 46 | - (void)setMaxValueForItemCount:(NSInteger)maxValueForItemCount{ 47 | if (maxValueForItemCount <= KDefaultMaxValue) { 48 | _maxValueForItemCount = maxValueForItemCount; 49 | }else{ 50 | _maxValueForItemCount = KDefaultMaxValue; 51 | } 52 | } 53 | 54 | 55 | - (instancetype)initWithFrame:(CGRect)frame{ 56 | if (self == [super initWithFrame:frame]) { 57 | [self setUpUI]; 58 | } 59 | return self; 60 | } 61 | - (void)setUpUI{ 62 | self.backgroundColor = [UIColor colorWithRed:61/255.0 green:61/255.0 blue:61/255.0 alpha:1]; 63 | arrowPointX = self.width * 0.5; 64 | UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kTriangleHeight, self.width, self.height)]; 65 | tableView.delegate = self; 66 | tableView.dataSource = self; 67 | tableView.bounces = NO; 68 | tableView.rowHeight = 40; 69 | tableView.showsVerticalScrollIndicator = NO; 70 | tableView.backgroundColor = [UIColor clearColor]; 71 | tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 72 | [tableView registerClass:[MenuTableViewCell class] forCellReuseIdentifier:NSStringFromClass([MenuTableViewCell class])]; 73 | 74 | self.contentTableView = tableView; 75 | self.height = tableView.height + kTriangleHeight * 2 - 0.5; 76 | self.alpha = 0; 77 | 78 | UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; 79 | backView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3]; 80 | [backView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]]; 81 | backView.alpha = 0; 82 | backView.tag = kCoverViewTag; 83 | _backView = backView; 84 | [[UIApplication sharedApplication].keyWindow addSubview:backView]; 85 | 86 | CAShapeLayer *lay = [self getBorderLayer]; 87 | self.layer.mask = lay; 88 | [self addSubview:tableView]; 89 | [[UIApplication sharedApplication].keyWindow addSubview:self]; 90 | } 91 | #pragma mark --- TableView DataSource 92 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 93 | return self.menuDataArray.count; 94 | } 95 | 96 | - (MenuTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 97 | MenuModel *model = self.menuDataArray[indexPath.row]; 98 | MenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MenuTableViewCell class]) forIndexPath:indexPath]; 99 | cell.menuModel = model; 100 | cell.backgroundColor = [UIColor clearColor]; 101 | return cell; 102 | } 103 | 104 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 105 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 106 | MenuModel *model = self.menuDataArray[indexPath.row]; 107 | if (self.itemsClickBlock) { 108 | self.itemsClickBlock(model.itemName,indexPath.row +1); 109 | } 110 | } 111 | 112 | #pragma mark --- 关于菜单展示 113 | - (void)displayAtPoint:(CGPoint)point{ 114 | 115 | point = [self.superview convertPoint:point toView:self.window]; 116 | self.layer.affineTransform = CGAffineTransformIdentity; 117 | [self adjustPosition:point]; // 调整展示的位置 - frame 118 | 119 | // 调整箭头位置 120 | if (point.x <= kMargin + kRadius + kTriangleHeight * 0.7) { 121 | arrowPointX = kMargin + kRadius; 122 | }else if (point.x >= kScreenWidth - kMargin - kRadius - kTriangleHeight * 0.7){ 123 | arrowPointX = self.width - kMargin - kRadius; 124 | }else{ 125 | arrowPointX = point.x - self.x; 126 | } 127 | 128 | // 调整anchorPoint 129 | CGPoint aPoint = CGPointMake(0.5, 0.5); 130 | if (CGRectGetMaxY(self.frame) > kScreenHeight) { 131 | aPoint = CGPointMake(arrowPointX / self.width, 1); 132 | }else{ 133 | aPoint = CGPointMake(arrowPointX / self.width, 0); 134 | } 135 | 136 | // 调整layer 137 | CAShapeLayer *layer = [self getBorderLayer]; 138 | if (self.max_Y> kScreenHeight) { 139 | layer.transform = CATransform3DMakeRotation(M_PI, 0, 1, 0); 140 | layer.transform = CATransform3DRotate(layer.transform, M_PI, 0, 0, 1); 141 | self.y = point.y - self.height; 142 | } 143 | 144 | // 调整frame 145 | CGRect rect = self.frame; 146 | self.layer.anchorPoint = aPoint; 147 | self.frame = rect; 148 | 149 | self.layer.mask = layer; 150 | self.layer.affineTransform = CGAffineTransformMakeScale(0.01, 0.01); 151 | [UIView animateWithDuration:0.25 animations:^{ 152 | self.alpha = 1; 153 | _backView.alpha = 0.3; 154 | self.layer.affineTransform = CGAffineTransformMakeScale(1.0, 1.0); 155 | }]; 156 | } 157 | 158 | - (void)adjustPosition:(CGPoint)point{ 159 | self.x = point.x - self.width * 0.5; 160 | self.y = point.y + kMargin; 161 | if (self.x < kMargin) { 162 | self.x = kMargin; 163 | }else if (self.x > kScreenWidth - kMargin - self.width){ 164 | self.x = kScreenWidth - kMargin - self.width; 165 | } 166 | self.layer.affineTransform = CGAffineTransformMakeScale(1.0, 1.0); 167 | } 168 | 169 | - (void)updateFrameForMenu{ 170 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 171 | menuView.maxValueForItemCount = menuView.menuDataArray.count; 172 | menuView.transform = CGAffineTransformMakeScale(1.0, 1.0);; 173 | menuView.contentTableView.height = 40 * menuView.maxValueForItemCount; 174 | menuView.height = 40 * menuView.maxValueForItemCount + kTriangleHeight * 2 - 0.5; 175 | menuView.layer.mask = [menuView getBorderLayer]; 176 | menuView.transform = CGAffineTransformMakeScale(0.01, 0.01); 177 | } 178 | 179 | - (void)hiddenMenu{ 180 | self.contentTableView.contentOffset = CGPointMake(0, 0); 181 | [UIView animateWithDuration:0.25 animations:^{ 182 | self.layer.affineTransform = CGAffineTransformMakeScale(0.01, 0.01); 183 | self.alpha = 0; 184 | _backView.alpha = 0; 185 | }]; 186 | } 187 | 188 | - (void)tap:(UITapGestureRecognizer *)sender{ 189 | if (self.backViewTapBlock) { 190 | self.backViewTapBlock(); 191 | } 192 | [self hiddenMenu]; 193 | 194 | } 195 | - (CAShapeLayer *)getBorderLayer{ 196 | // 上下左右的圆角中心点 197 | CGPoint upperLeftCornerCenter = CGPointMake(kRadius, kTriangleHeight + kRadius); 198 | CGPoint upperRightCornerCenter = CGPointMake(self.width - kRadius, kTriangleHeight + kRadius); 199 | CGPoint bottomLeftCornerCenter = CGPointMake(kRadius, self.height - kTriangleHeight - kRadius); 200 | CGPoint bottomRightCornerCenter = CGPointMake(self.width - kRadius, self.height - kTriangleHeight - kRadius); 201 | 202 | CAShapeLayer *borderLayer = [CAShapeLayer layer]; 203 | borderLayer.frame = self.bounds; 204 | UIBezierPath *bezierPath = [UIBezierPath bezierPath]; 205 | [bezierPath moveToPoint:CGPointMake(0, kTriangleHeight + kRadius)]; 206 | [bezierPath addArcWithCenter:upperLeftCornerCenter radius:kRadius startAngle:M_PI endAngle:M_PI * 3 * 0.5 clockwise:YES]; 207 | [bezierPath addLineToPoint:CGPointMake(arrowPointX - kTriangleHeight * 0.7, kTriangleHeight)]; 208 | [bezierPath addLineToPoint:CGPointMake(arrowPointX, 0)]; 209 | [bezierPath addLineToPoint:CGPointMake(arrowPointX + kTriangleHeight * 0.7, kTriangleHeight)]; 210 | [bezierPath addLineToPoint:CGPointMake(self.width - kRadius, kTriangleHeight)]; 211 | [bezierPath addArcWithCenter:upperRightCornerCenter radius:kRadius startAngle:M_PI * 3 * 0.5 endAngle:0 clockwise:YES]; 212 | [bezierPath addLineToPoint:CGPointMake(self.width, self.height - kTriangleHeight - kRadius)]; 213 | [bezierPath addArcWithCenter:bottomRightCornerCenter radius:kRadius startAngle:0 endAngle:M_PI_2 clockwise:YES]; 214 | [bezierPath addLineToPoint:CGPointMake(kRadius, self.height - kTriangleHeight)]; 215 | [bezierPath addArcWithCenter:bottomLeftCornerCenter radius:kRadius startAngle:M_PI_2 endAngle:M_PI clockwise:YES]; 216 | [bezierPath addLineToPoint:CGPointMake(0, kTriangleHeight + kRadius)]; 217 | [bezierPath closePath]; 218 | borderLayer.path = bezierPath.CGPath; 219 | return borderLayer; 220 | } 221 | 222 | #pragma mark --- 类方法封装 223 | + (CommonMenuView *)createMenuWithFrame:(CGRect)frame target:(UIViewController *)target dataArray:(NSArray *)dataArray itemsClickBlock:(void(^)(NSString *str, NSInteger tag))itemsClickBlock backViewTap:(void(^)())backViewTapBlock{ 224 | 225 | CGFloat menuWidth = frame.size.width ? frame.size.width : 120; 226 | 227 | CommonMenuView *menuView = [[CommonMenuView alloc] initWithFrame:CGRectMake(0, 0, menuWidth, 40 * dataArray.count)]; 228 | menuView.selfMenu = menuView; 229 | menuView.itemsClickBlock = itemsClickBlock; 230 | menuView.backViewTapBlock = backViewTapBlock; 231 | menuView.menuDataArray = [NSMutableArray arrayWithArray:dataArray]; 232 | menuView.maxValueForItemCount = 6; 233 | menuView.tag = kMenuTag; 234 | return menuView; 235 | } 236 | 237 | + (void)showMenuAtPoint:(CGPoint)point{ 238 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 239 | [menuView displayAtPoint:point]; 240 | } 241 | 242 | + (void)hidden{ 243 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 244 | [menuView hiddenMenu]; 245 | } 246 | 247 | + (void)clearMenu{ 248 | [CommonMenuView hidden]; 249 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 250 | UIView *coverView = [[UIApplication sharedApplication].keyWindow viewWithTag:kCoverViewTag]; 251 | [menuView removeFromSuperview]; 252 | [coverView removeFromSuperview]; 253 | } 254 | 255 | + (void)appendMenuItemsWith:(NSArray *)appendItemsArray{ 256 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 257 | NSMutableArray *tempMutableArr = [NSMutableArray arrayWithArray:menuView.menuDataArray]; 258 | [tempMutableArr addObjectsFromArray:appendItemsArray]; 259 | menuView.menuDataArray = tempMutableArr; 260 | [menuView.contentTableView reloadData]; 261 | [menuView updateFrameForMenu]; 262 | } 263 | 264 | + (void)updateMenuItemsWith:(NSArray *)newItemsArray{ 265 | CommonMenuView *menuView = [[UIApplication sharedApplication].keyWindow viewWithTag:kMenuTag]; 266 | [menuView.menuDataArray removeAllObjects]; 267 | menuView.menuDataArray = [NSMutableArray arrayWithArray:newItemsArray]; 268 | [menuView.contentTableView reloadData]; 269 | [menuView updateFrameForMenu]; 270 | } 271 | 272 | 273 | @end 274 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/MenuModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuModel.h 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/2. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MenuModel : NSObject 12 | 13 | @property (nonatomic,copy) NSString *imageName; 14 | @property (nonatomic,copy) NSString *itemName; 15 | 16 | + (instancetype)MenuModelWithDict:(NSDictionary *)dict; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/MenuModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuModel.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/2. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import "MenuModel.h" 10 | 11 | @implementation MenuModel 12 | 13 | - (instancetype)initWithDict:(NSDictionary *)dict{ 14 | if (self == [super init]) { 15 | [self setValuesForKeysWithDictionary:dict]; 16 | } 17 | return self; 18 | } 19 | 20 | + (instancetype)MenuModelWithDict:(NSDictionary *)dict{ 21 | return [[self alloc] initWithDict:dict]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/MenuTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuTableViewCell.h 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/2. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MenuModel.h" 11 | 12 | @interface MenuTableViewCell : UITableViewCell 13 | 14 | @property (nonatomic,strong) MenuModel * menuModel; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/MenuTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuTableViewCell.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/2. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import "MenuTableViewCell.h" 10 | 11 | @implementation MenuTableViewCell { 12 | UIView *_lineView; 13 | } 14 | 15 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 16 | if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 17 | [self setUpUI]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)setUpUI{ 23 | UIView *lineView = [[UIView alloc] init]; 24 | lineView.backgroundColor = [UIColor lightGrayColor]; 25 | _lineView = lineView; 26 | [self addSubview:lineView]; 27 | self.backgroundColor = [UIColor clearColor]; 28 | self.textLabel.font = [UIFont systemFontOfSize:14]; 29 | self.textLabel.textColor = [UIColor whiteColor]; 30 | self.selectionStyle = UITableViewCellSelectionStyleNone; 31 | } 32 | 33 | - (void)layoutSubviews{ 34 | [super layoutSubviews]; 35 | _lineView.frame = CGRectMake(4, self.bounds.size.height - 1, self.bounds.size.width - 8, 0.5); 36 | } 37 | 38 | - (void)setMenuModel:(MenuModel *)menuModel{ 39 | _menuModel = menuModel; 40 | self.imageView.image = [UIImage imageNamed:menuModel.imageName]; 41 | self.textLabel.text = menuModel.itemName; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/UIView+AdjustFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+AdjustFrame.h 3 | // 4 | // 5 | // Created by apple on 14-12-7. 6 | // Copyright (c) 2014年. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (AdjustFrame) 12 | 13 | @property (assign, nonatomic) CGFloat x; 14 | @property (assign, nonatomic) CGFloat y; 15 | @property (nonatomic,assign) CGFloat max_X; 16 | @property (nonatomic,assign) CGFloat max_Y; 17 | @property (nonatomic, assign) CGFloat centerX; 18 | @property (nonatomic, assign) CGFloat centerY; 19 | @property (assign, nonatomic) CGFloat width; 20 | @property (assign, nonatomic) CGFloat height; 21 | @property (assign, nonatomic) CGSize size; 22 | @property (assign, nonatomic) CGPoint origin; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /PopMenuTableView/Menu/UIView+AdjustFrame.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+AdjustFrame.m 3 | // 4 | // 5 | // Created by apple on 14-12-7. 6 | // Copyright (c) 2014年. All rights reserved. 7 | // 8 | 9 | #import "UIView+AdjustFrame.h" 10 | 11 | @implementation UIView (AdjustFrame) 12 | 13 | - (void)setX:(CGFloat)x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setY:(CGFloat)y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setWidth:(CGFloat)width 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = width; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)max_X{ 45 | return CGRectGetMaxX(self.frame); 46 | } 47 | - (void)setMax_X:(CGFloat)max_X{} 48 | 49 | - (CGFloat)max_Y{ 50 | return CGRectGetMaxY(self.frame); 51 | } 52 | - (void)setMax_Y:(CGFloat)max_Y{} 53 | 54 | - (CGFloat)width 55 | { 56 | return self.frame.size.width; 57 | } 58 | 59 | - (void)setHeight:(CGFloat)height 60 | { 61 | CGRect frame = self.frame; 62 | frame.size.height = height; 63 | self.frame = frame; 64 | } 65 | 66 | - (CGFloat)height 67 | { 68 | return self.frame.size.height; 69 | } 70 | 71 | - (void)setSize:(CGSize)size 72 | { 73 | CGRect frame = self.frame; 74 | frame.size = size; 75 | self.frame = frame; 76 | } 77 | 78 | - (CGSize)size 79 | { 80 | return self.frame.size; 81 | } 82 | 83 | - (void)setOrigin:(CGPoint)origin 84 | { 85 | CGRect frame = self.frame; 86 | frame.origin = origin; 87 | self.frame = frame; 88 | } 89 | 90 | - (CGPoint)origin 91 | { 92 | return self.frame.origin; 93 | } 94 | 95 | - (void)setCenterX:(CGFloat)centerX 96 | { 97 | CGPoint center = self.center; 98 | center.x = centerX; 99 | self.center = center; 100 | } 101 | 102 | - (CGFloat)centerX 103 | { 104 | return self.center.x; 105 | } 106 | 107 | - (void)setCenterY:(CGFloat)centerY 108 | { 109 | CGPoint center = self.center; 110 | center.y = centerY; 111 | self.center = center; 112 | } 113 | 114 | - (CGFloat)centerY 115 | { 116 | return self.center.y; 117 | } 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /PopMenuTableView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PopMenuTableView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 KongPro. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CommonMenuView.h" 11 | #import "UIView+AdjustFrame.h" 12 | 13 | @interface ViewController () 14 | 15 | @property (nonatomic,assign) BOOL flag; 16 | @property (nonatomic,assign) int itemCount; 17 | @property (weak, nonatomic) IBOutlet UILabel *numberLabel; 18 | 19 | @end 20 | 21 | @implementation ViewController { 22 | NSArray *_dataArray; 23 | } 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | /** 28 | * rightBarButton的点击标记,每次点击更改flag值。 29 | * 如果您用普通的button就不需要设置flag,通过按钮的seleted属性来控制即可 30 | */ 31 | self.flag = YES; 32 | 33 | /** 34 | * 这些数据是菜单显示的图片名称和菜单文字,请各位大牛指教,如果有更好的方法: 35 | * QQ : 827023449 (好友验证的问题随便写,最好有针对性) 36 | * e-mail : KongPro@163.com,喜欢请在github上点颗星星,不胜感激! 🙏 37 | * GitHub : https://github.com/KongPro/PopMenuTableView 38 | */ 39 | NSDictionary *dict1 = @{@"imageName" : @"icon_button_affirm", 40 | @"itemName" : @"撤回" 41 | }; 42 | NSDictionary *dict2 = @{@"imageName" : @"icon_button_recall", 43 | @"itemName" : @"确认" 44 | }; 45 | NSDictionary *dict3 = @{@"imageName" : @"icon_button_record", 46 | @"itemName" : @"记录" 47 | }; 48 | NSArray *dataArray = @[dict1,dict2,dict3]; 49 | _dataArray = dataArray; 50 | 51 | __weak __typeof(&*self)weakSelf = self; 52 | /** 53 | * 创建普通的MenuView,frame可以传递空值,宽度默认120,高度自适应 54 | */ 55 | [CommonMenuView createMenuWithFrame:CGRectZero target:self dataArray:dataArray itemsClickBlock:^(NSString *str, NSInteger tag) { 56 | [weakSelf doSomething:(NSString *)str tag:(NSInteger)tag]; // do something 57 | } backViewTap:^{ 58 | weakSelf.flag = YES; // 这里的目的是,让rightButton点击,可再次pop出menu 59 | }]; 60 | } 61 | 62 | #pragma mark -- Nav上的四个button 63 | - (IBAction)popMenuOrganize:(id)sender { 64 | [self popMenu:CGPointMake(self.navigationController.view.width - 30, 50)]; 65 | } 66 | - (IBAction)popMenuCompose:(id)sender { 67 | [self popMenu:CGPointMake(self.navigationController.view.width - 80, 50)]; 68 | } 69 | - (IBAction)popMenuAction:(id)sender { 70 | [self popMenu:CGPointMake(75, 50)]; 71 | } 72 | - (IBAction)popMenuAdd:(id)sender { 73 | [self popMenu:CGPointMake(30, 50)]; 74 | } 75 | - (void)popMenu:(CGPoint)point{ 76 | if (self.flag) { 77 | [CommonMenuView showMenuAtPoint:point]; 78 | self.flag = NO; 79 | }else{ 80 | [CommonMenuView hidden]; 81 | self.flag = YES; 82 | } 83 | } 84 | 85 | 86 | #pragma mark -- 增加一个菜单项 87 | - (IBAction)addMenuItem:(id)sender { 88 | 89 | NSDictionary *addDict = @{@"imageName" : @"icon_button_recall", 90 | @"itemName" : [NSString stringWithFormat:@"新增项%d",self.itemCount + 1] 91 | }; 92 | NSArray *newItemArray = @[addDict]; 93 | /** 94 | * 追加菜单项 95 | */ 96 | [CommonMenuView appendMenuItemsWith:newItemArray]; 97 | 98 | self.itemCount ++; 99 | self.numberLabel.text = [NSString stringWithFormat:@"累计增加 %d 项", self.itemCount]; 100 | } 101 | 102 | #pragma mark -- 恢复菜单项 103 | - (IBAction)removeMenuItem:(id)sender { 104 | /** 105 | * 更新菜单 106 | */ 107 | [CommonMenuView updateMenuItemsWith:_dataArray]; 108 | 109 | self.itemCount = 0; 110 | self.numberLabel.text = [NSString stringWithFormat:@"累计增加 %d 项", self.itemCount]; 111 | } 112 | 113 | #pragma mark -- 回调事件(自定义) 114 | - (void)doSomething:(NSString *)str tag:(NSInteger)tag{ 115 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:str message:[NSString stringWithFormat:@"点击了第%ld个菜单项",tag] preferredStyle:UIAlertControllerStyleAlert]; 116 | UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 117 | }]; 118 | [alertController addAction:action]; 119 | [self presentViewController:alertController animated:YES completion:nil]; 120 | 121 | [CommonMenuView hidden]; 122 | self.flag = YES; 123 | } 124 | 125 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 126 | UITouch *touch = touches.anyObject; 127 | CGPoint point = [touch locationInView:touch.view]; 128 | [CommonMenuView showMenuAtPoint:point]; 129 | } 130 | 131 | #pragma mark -- dealloc:释放菜单 132 | - (void)dealloc{ 133 | [CommonMenuView clearMenu]; // 移除菜单 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /PopMenuTableView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PopMenuTableView 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 孔繁武. 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 | -------------------------------------------------------------------------------- /PopMenuTableViewTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PopMenuTableViewTests/PopMenuTableViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PopMenuTableViewTests.m 3 | // PopMenuTableViewTests 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 孔繁武. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PopMenuTableViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PopMenuTableViewTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PopMenuTableViewUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PopMenuTableViewUITests/PopMenuTableViewUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PopMenuTableViewUITests.m 3 | // PopMenuTableViewUITests 4 | // 5 | // Created by 孔繁武 on 16/8/1. 6 | // Copyright © 2016年 孔繁武. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PopMenuTableViewUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PopMenuTableViewUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PopMenuTableView 2 | ## Easy to use this menu,that like iPad. 3 | `尴尬:图片抽搐了,下载运行看吧...` 4 | 5 | ![动态菜单](http://www.code4app.com/data/attachment/forum/201701/17/143035at0ftffqtt0tfctc.gif) 6 | 7 | ## 更新描述 8 | * 自适应方向,自适应箭头指示位置。 9 | * 新增追加菜单项:在原有菜单基础上,增加一个或者多个菜单按钮。 10 | * 更新菜单项内容:在原有菜单基础上,更新所有的菜单项内容。(**_`也可以局部更新`_**)。 11 | * 同样都是类方法实现,不需要显示的创建对象。 12 | * ⚠️使用方法依旧只需要传递内容数组,无需其他多余步骤。 13 | * **(⚠️注:所有的方法都是类方法,直接用类名调用即可,_`并留意文档最后的的参数说明`_)** 14 | 15 | ## 代码示例: 16 | ### 1. `类方法创建:` 17 | 18 | * 传递参数说明dataArray -- 由菜单文字内容及图片名称组成的**`字典数组`** 19 | 20 | ```Objective-C 21 | __weak __typeof(&*self)weakSelf = self; 22 | /** 23 | * 创建menu 24 | */ 25 | [CommonMenuView createMenuWithFrame : CGRectMake(x, y, width, height) 26 | target : self.navigationController 27 | dataArray : dataArray 28 | itemsClickBlock : ^(NSString *str, NSInteger tag) { /* do something */ } 29 | backViewTap : ^{ /* 点击背景遮罩view后的block,可自定义事件 */ }]; 30 | ``` 31 | 32 | ### 2. `展示` 33 | * **方法名称:** 34 | 35 | ```Objective-C 36 |      + (void)showMenuAtPoint:(CGPoint)point; 37 | ``` 38 | * **说明:** 39 |   _根据菜单展示的位置,指示箭头默认适应点击坐标,高度超出屏幕,菜单自动翻转。_ 40 | 41 | * **调用示例:**   42 | ```Objective-C 43 |      // point,展示的坐标 44 |      + (void)showMenuAtPoint:(CGPoint)point; 45 | ``` 46 | ### 3. `追加菜单项:` 47 | * **方法名称:** 48 | ```Objective-C 49 | [CommonMenuView showMenuAtPoint:point]; 50 | ``` 51 | 52 | * **说明:** 53 | _在原有菜单项个数基础上,**`追加`**的菜单项(例如:原有菜单中有三项,需要**`增加第四,第五...项`**等),可以实现**`动态增加`**菜单项`_ 54 | 55 | * **调用示例:** 56 | ```Objective-C 57 | //拼接字典数组,这里可以使用 58 | NSDictionary *addDict = @{@"imageName" : @"icon_button_recall", 59 | @"itemName" : @"新增项" 60 | }; 61 | NSArray *newItemArray = @[addDict]; 62 | 63 | // 调用:参数newItemArray :追加的菜单项字典拼接成的数组 64 | [CommonMenuView appendMenuItemsWith:newItemArray]; 65 | ``` 66 | 67 | ### 4. `更新菜单项:` 68 | * **方法名称:** 69 | ```Objective-C 70 | + (void)updateMenuItemsWith:(NSArray *)newItemsArray; 71 | ``` 72 | 73 | * **说明:** 74 | _**`更新修改所有`**菜单的内容,根据传入的**`字典数组`**内容,动态更新菜单项,只需要传递数组即可,其他无需多虑`_ 75 | 76 | * **调用示例:** 77 | ```Objective-C 78 | - (IBAction)removeMenuItem:(id)sender { 79 | /** 80 | * 更新菜单: _dataArray是控制器中全局字典数组,存的是菜单项图标和功能名称 81 | */ 82 | [CommonMenuView updateMenuItemsWith:_dataArray]; 83 | } 84 | ``` 85 | 86 | ### 5.`隐藏和移除:` 87 | * **方法名称:** 88 | ```Objective-C 89 | /* 隐藏菜单 */ 90 | + (void)hidden; 91 | 92 | /* 移除菜单 */ 93 | + (void)clearMenu; 94 | ``` 95 | 96 | * **说明:** 97 |   1 ._只要程序不退出,只要不执行**`clearMenu`**方法,创建的菜单对象就一直在内存中。若有在其他控制器利用类方法调用并展示,一旦菜单项不同,请调用**`updateMenuItemsWith:`**方法更新菜单项目。_ 98 | 99 |   2 ._隐藏:对菜单的size进行缩小,考虑到当控制器始终存在时,即用户**`没有进行push,或者退出app`**的操作(pop的情况下面会提到)时,就没必要移除菜单,避免需要菜单时的反复创建,此时应调用**`hidden方法`**_ 100 | 101 |   3 ._移除:从父试图remove掉,当用户进行**`pop`**,或者**`退出app`**的操作(控制器已经被销毁,就没必要保留菜单并占用内存空间了)时,应当调用**`clearMenu`**方法_ 102 | 103 | * **调用示例:** 104 | ```Objective-C 105 | [CommonMenuView hidden]; // 隐藏菜单 106 | [CommonMenuView clearMenu]; // 移除菜单 107 | ``` 108 | 109 | ## `参数描述:` 110 | * fame: 菜单坐标和宽高 **`(非必填,高度自适应,width默认120)`** 111 | * target:菜单将要展示的所在控制器 **`(参数必填)`** 112 | * dataArray:菜单项内容 **`(必填参数)`** 113 | * itemsClickBlock:点击菜单的block回调,回调菜单文字和下标 114 | * backViewTap:半透明背景点击回调 115 | 116 | ### `温馨提示:` 117 | * demo在Nav展示时候,fram的origin是自己写死的,至今没有找到能获取nav上按钮所在point的方法,如果大神们有好方法,或者对这个demo有改进意见,请发邮件:KongPro@163.com,不胜感激~🙏🙏🙏 118 | -------------------------------------------------------------------------------- /代码示例: -------------------------------------------------------------------------------- 1 | _menuView = [MenuView createMenuWithFrame:CGRectMake(x, y, width, height) target:self.navigationController dataArray:dataArray itemsClickBlock:^(NSString *str, NSInteger tag) { 2 | 3 | // do something 4 | [weakSelf doSomething:(NSString *)str tag:(NSInteger)tag]; 5 | 6 | } backViewTap:^{ 7 | // 点击背景遮罩view后的block,可自定义事件 8 | // 这里的目的是,让rightButton点击,可再次pop出menu 9 | weakSelf.flag = YES; 10 | _menuView = nil; 11 | 12 | }]; 13 | --------------------------------------------------------------------------------