├── .gitignore ├── LICENSE ├── README.md └── ShadowTableViewGroupDemo ├── ShadowTableViewGroupDemo.xcodeproj └── project.pbxproj ├── ShadowTableViewGroupDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── icon.imageset │ │ ├── Contents.json │ │ └── icon@2x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── GroupShadowTableView │ ├── GroupShadowTableView.h │ └── GroupShadowTableView.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── ShadowTableViewGroupDemoTests ├── Info.plist └── ShadowTableViewGroupDemoTests.m └── ShadowTableViewGroupDemoUITests ├── Info.plist └── ShadowTableViewGroupDemoUITests.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 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 BabyWong 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 | # tableviewSection- 2 | - 让Tableview 每个Section拥有圆角加阴影。 3 | 4 | [原文链接](http://code.cocoachina.com/view/133454) 5 | 6 | 7 | ![效果图](http://upload-images.jianshu.io/upload_images/817974-f98e5f854b61f00d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 8 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F517F3931E0929A400DCC658 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3921E0929A400DCC658 /* main.m */; }; 11 | F517F3961E0929A400DCC658 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3951E0929A400DCC658 /* AppDelegate.m */; }; 12 | F517F3991E0929A400DCC658 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3981E0929A400DCC658 /* ViewController.m */; }; 13 | F517F39C1E0929A400DCC658 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F517F39A1E0929A400DCC658 /* Main.storyboard */; }; 14 | F517F39E1E0929A400DCC658 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F517F39D1E0929A400DCC658 /* Assets.xcassets */; }; 15 | F517F3A11E0929A400DCC658 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F517F39F1E0929A400DCC658 /* LaunchScreen.storyboard */; }; 16 | F517F3AC1E0929A400DCC658 /* ShadowTableViewGroupDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3AB1E0929A400DCC658 /* ShadowTableViewGroupDemoTests.m */; }; 17 | F517F3B71E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3B61E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.m */; }; 18 | F517F3C71E0929EA00DCC658 /* GroupShadowTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F517F3C61E0929EA00DCC658 /* GroupShadowTableView.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | F517F3A81E0929A400DCC658 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = F517F3861E0929A400DCC658 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = F517F38D1E0929A400DCC658; 27 | remoteInfo = ShadowTableViewGroupDemo; 28 | }; 29 | F517F3B31E0929A400DCC658 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = F517F3861E0929A400DCC658 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = F517F38D1E0929A400DCC658; 34 | remoteInfo = ShadowTableViewGroupDemo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | F517F38E1E0929A400DCC658 /* ShadowTableViewGroupDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShadowTableViewGroupDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | F517F3921E0929A400DCC658 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | F517F3941E0929A400DCC658 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | F517F3951E0929A400DCC658 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | F517F3971E0929A400DCC658 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | F517F3981E0929A400DCC658 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | F517F39B1E0929A400DCC658 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | F517F39D1E0929A400DCC658 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | F517F3A01E0929A400DCC658 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | F517F3A21E0929A400DCC658 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | F517F3A71E0929A400DCC658 /* ShadowTableViewGroupDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShadowTableViewGroupDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | F517F3AB1E0929A400DCC658 /* ShadowTableViewGroupDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShadowTableViewGroupDemoTests.m; sourceTree = ""; }; 51 | F517F3AD1E0929A400DCC658 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | F517F3B21E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShadowTableViewGroupDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | F517F3B61E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShadowTableViewGroupDemoUITests.m; sourceTree = ""; }; 54 | F517F3B81E0929A400DCC658 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | F517F3C51E0929EA00DCC658 /* GroupShadowTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShadowTableView.h; sourceTree = ""; }; 56 | F517F3C61E0929EA00DCC658 /* GroupShadowTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupShadowTableView.m; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | F517F38B1E0929A400DCC658 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | F517F3A41E0929A400DCC658 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | F517F3AF1E0929A400DCC658 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | F517F3851E0929A400DCC658 = { 85 | isa = PBXGroup; 86 | children = ( 87 | F517F3901E0929A400DCC658 /* ShadowTableViewGroupDemo */, 88 | F517F3AA1E0929A400DCC658 /* ShadowTableViewGroupDemoTests */, 89 | F517F3B51E0929A400DCC658 /* ShadowTableViewGroupDemoUITests */, 90 | F517F38F1E0929A400DCC658 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | F517F38F1E0929A400DCC658 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | F517F38E1E0929A400DCC658 /* ShadowTableViewGroupDemo.app */, 98 | F517F3A71E0929A400DCC658 /* ShadowTableViewGroupDemoTests.xctest */, 99 | F517F3B21E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | F517F3901E0929A400DCC658 /* ShadowTableViewGroupDemo */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | F517F3C41E0929CF00DCC658 /* GroupShadowTableView */, 108 | F517F3941E0929A400DCC658 /* AppDelegate.h */, 109 | F517F3951E0929A400DCC658 /* AppDelegate.m */, 110 | F517F3971E0929A400DCC658 /* ViewController.h */, 111 | F517F3981E0929A400DCC658 /* ViewController.m */, 112 | F517F39A1E0929A400DCC658 /* Main.storyboard */, 113 | F517F39D1E0929A400DCC658 /* Assets.xcassets */, 114 | F517F39F1E0929A400DCC658 /* LaunchScreen.storyboard */, 115 | F517F3A21E0929A400DCC658 /* Info.plist */, 116 | F517F3911E0929A400DCC658 /* Supporting Files */, 117 | ); 118 | path = ShadowTableViewGroupDemo; 119 | sourceTree = ""; 120 | }; 121 | F517F3911E0929A400DCC658 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | F517F3921E0929A400DCC658 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | F517F3AA1E0929A400DCC658 /* ShadowTableViewGroupDemoTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | F517F3AB1E0929A400DCC658 /* ShadowTableViewGroupDemoTests.m */, 133 | F517F3AD1E0929A400DCC658 /* Info.plist */, 134 | ); 135 | path = ShadowTableViewGroupDemoTests; 136 | sourceTree = ""; 137 | }; 138 | F517F3B51E0929A400DCC658 /* ShadowTableViewGroupDemoUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | F517F3B61E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.m */, 142 | F517F3B81E0929A400DCC658 /* Info.plist */, 143 | ); 144 | path = ShadowTableViewGroupDemoUITests; 145 | sourceTree = ""; 146 | }; 147 | F517F3C41E0929CF00DCC658 /* GroupShadowTableView */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | F517F3C51E0929EA00DCC658 /* GroupShadowTableView.h */, 151 | F517F3C61E0929EA00DCC658 /* GroupShadowTableView.m */, 152 | ); 153 | path = GroupShadowTableView; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | F517F38D1E0929A400DCC658 /* ShadowTableViewGroupDemo */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = F517F3BB1E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemo" */; 162 | buildPhases = ( 163 | F517F38A1E0929A400DCC658 /* Sources */, 164 | F517F38B1E0929A400DCC658 /* Frameworks */, 165 | F517F38C1E0929A400DCC658 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = ShadowTableViewGroupDemo; 172 | productName = ShadowTableViewGroupDemo; 173 | productReference = F517F38E1E0929A400DCC658 /* ShadowTableViewGroupDemo.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | F517F3A61E0929A400DCC658 /* ShadowTableViewGroupDemoTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = F517F3BE1E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemoTests" */; 179 | buildPhases = ( 180 | F517F3A31E0929A400DCC658 /* Sources */, 181 | F517F3A41E0929A400DCC658 /* Frameworks */, 182 | F517F3A51E0929A400DCC658 /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | F517F3A91E0929A400DCC658 /* PBXTargetDependency */, 188 | ); 189 | name = ShadowTableViewGroupDemoTests; 190 | productName = ShadowTableViewGroupDemoTests; 191 | productReference = F517F3A71E0929A400DCC658 /* ShadowTableViewGroupDemoTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | F517F3B11E0929A400DCC658 /* ShadowTableViewGroupDemoUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = F517F3C11E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemoUITests" */; 197 | buildPhases = ( 198 | F517F3AE1E0929A400DCC658 /* Sources */, 199 | F517F3AF1E0929A400DCC658 /* Frameworks */, 200 | F517F3B01E0929A400DCC658 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | F517F3B41E0929A400DCC658 /* PBXTargetDependency */, 206 | ); 207 | name = ShadowTableViewGroupDemoUITests; 208 | productName = ShadowTableViewGroupDemoUITests; 209 | productReference = F517F3B21E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | F517F3861E0929A400DCC658 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0810; 219 | ORGANIZATIONNAME = hwm; 220 | TargetAttributes = { 221 | F517F38D1E0929A400DCC658 = { 222 | CreatedOnToolsVersion = 8.1; 223 | DevelopmentTeam = R494QZ4GU8; 224 | ProvisioningStyle = Automatic; 225 | }; 226 | F517F3A61E0929A400DCC658 = { 227 | CreatedOnToolsVersion = 8.1; 228 | DevelopmentTeam = R494QZ4GU8; 229 | ProvisioningStyle = Automatic; 230 | TestTargetID = F517F38D1E0929A400DCC658; 231 | }; 232 | F517F3B11E0929A400DCC658 = { 233 | CreatedOnToolsVersion = 8.1; 234 | DevelopmentTeam = R494QZ4GU8; 235 | ProvisioningStyle = Automatic; 236 | TestTargetID = F517F38D1E0929A400DCC658; 237 | }; 238 | }; 239 | }; 240 | buildConfigurationList = F517F3891E0929A400DCC658 /* Build configuration list for PBXProject "ShadowTableViewGroupDemo" */; 241 | compatibilityVersion = "Xcode 3.2"; 242 | developmentRegion = English; 243 | hasScannedForEncodings = 0; 244 | knownRegions = ( 245 | en, 246 | Base, 247 | ); 248 | mainGroup = F517F3851E0929A400DCC658; 249 | productRefGroup = F517F38F1E0929A400DCC658 /* Products */; 250 | projectDirPath = ""; 251 | projectRoot = ""; 252 | targets = ( 253 | F517F38D1E0929A400DCC658 /* ShadowTableViewGroupDemo */, 254 | F517F3A61E0929A400DCC658 /* ShadowTableViewGroupDemoTests */, 255 | F517F3B11E0929A400DCC658 /* ShadowTableViewGroupDemoUITests */, 256 | ); 257 | }; 258 | /* End PBXProject section */ 259 | 260 | /* Begin PBXResourcesBuildPhase section */ 261 | F517F38C1E0929A400DCC658 /* Resources */ = { 262 | isa = PBXResourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | F517F3A11E0929A400DCC658 /* LaunchScreen.storyboard in Resources */, 266 | F517F39E1E0929A400DCC658 /* Assets.xcassets in Resources */, 267 | F517F39C1E0929A400DCC658 /* Main.storyboard in Resources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | F517F3A51E0929A400DCC658 /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | F517F3B01E0929A400DCC658 /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXResourcesBuildPhase section */ 286 | 287 | /* Begin PBXSourcesBuildPhase section */ 288 | F517F38A1E0929A400DCC658 /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | F517F3991E0929A400DCC658 /* ViewController.m in Sources */, 293 | F517F3961E0929A400DCC658 /* AppDelegate.m in Sources */, 294 | F517F3931E0929A400DCC658 /* main.m in Sources */, 295 | F517F3C71E0929EA00DCC658 /* GroupShadowTableView.m in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | F517F3A31E0929A400DCC658 /* Sources */ = { 300 | isa = PBXSourcesBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | F517F3AC1E0929A400DCC658 /* ShadowTableViewGroupDemoTests.m in Sources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | F517F3AE1E0929A400DCC658 /* Sources */ = { 308 | isa = PBXSourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | F517F3B71E0929A400DCC658 /* ShadowTableViewGroupDemoUITests.m in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | /* End PBXSourcesBuildPhase section */ 316 | 317 | /* Begin PBXTargetDependency section */ 318 | F517F3A91E0929A400DCC658 /* PBXTargetDependency */ = { 319 | isa = PBXTargetDependency; 320 | target = F517F38D1E0929A400DCC658 /* ShadowTableViewGroupDemo */; 321 | targetProxy = F517F3A81E0929A400DCC658 /* PBXContainerItemProxy */; 322 | }; 323 | F517F3B41E0929A400DCC658 /* PBXTargetDependency */ = { 324 | isa = PBXTargetDependency; 325 | target = F517F38D1E0929A400DCC658 /* ShadowTableViewGroupDemo */; 326 | targetProxy = F517F3B31E0929A400DCC658 /* PBXContainerItemProxy */; 327 | }; 328 | /* End PBXTargetDependency section */ 329 | 330 | /* Begin PBXVariantGroup section */ 331 | F517F39A1E0929A400DCC658 /* Main.storyboard */ = { 332 | isa = PBXVariantGroup; 333 | children = ( 334 | F517F39B1E0929A400DCC658 /* Base */, 335 | ); 336 | name = Main.storyboard; 337 | sourceTree = ""; 338 | }; 339 | F517F39F1E0929A400DCC658 /* LaunchScreen.storyboard */ = { 340 | isa = PBXVariantGroup; 341 | children = ( 342 | F517F3A01E0929A400DCC658 /* Base */, 343 | ); 344 | name = LaunchScreen.storyboard; 345 | sourceTree = ""; 346 | }; 347 | /* End PBXVariantGroup section */ 348 | 349 | /* Begin XCBuildConfiguration section */ 350 | F517F3B91E0929A400DCC658 /* Debug */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_SEARCH_USER_PATHS = NO; 354 | CLANG_ANALYZER_NONNULL = YES; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 363 | CLANG_WARN_EMPTY_BODY = YES; 364 | CLANG_WARN_ENUM_CONVERSION = YES; 365 | CLANG_WARN_INFINITE_RECURSION = YES; 366 | CLANG_WARN_INT_CONVERSION = YES; 367 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 368 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 369 | CLANG_WARN_UNREACHABLE_CODE = YES; 370 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 371 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 372 | COPY_PHASE_STRIP = NO; 373 | DEBUG_INFORMATION_FORMAT = dwarf; 374 | ENABLE_STRICT_OBJC_MSGSEND = YES; 375 | ENABLE_TESTABILITY = YES; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_DYNAMIC_NO_PIC = NO; 378 | GCC_NO_COMMON_BLOCKS = YES; 379 | GCC_OPTIMIZATION_LEVEL = 0; 380 | GCC_PREPROCESSOR_DEFINITIONS = ( 381 | "DEBUG=1", 382 | "$(inherited)", 383 | ); 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 391 | MTL_ENABLE_DEBUG_INFO = YES; 392 | ONLY_ACTIVE_ARCH = YES; 393 | SDKROOT = iphoneos; 394 | }; 395 | name = Debug; 396 | }; 397 | F517F3BA1E0929A400DCC658 /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ALWAYS_SEARCH_USER_PATHS = NO; 401 | CLANG_ANALYZER_NONNULL = YES; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INFINITE_RECURSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 415 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 419 | COPY_PHASE_STRIP = NO; 420 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 421 | ENABLE_NS_ASSERTIONS = NO; 422 | ENABLE_STRICT_OBJC_MSGSEND = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu99; 424 | GCC_NO_COMMON_BLOCKS = YES; 425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 427 | GCC_WARN_UNDECLARED_SELECTOR = YES; 428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 429 | GCC_WARN_UNUSED_FUNCTION = YES; 430 | GCC_WARN_UNUSED_VARIABLE = YES; 431 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 432 | MTL_ENABLE_DEBUG_INFO = NO; 433 | SDKROOT = iphoneos; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | F517F3BC1E0929A400DCC658 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 442 | DEVELOPMENT_TEAM = R494QZ4GU8; 443 | INFOPLIST_FILE = ShadowTableViewGroupDemo/Info.plist; 444 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemo; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | }; 449 | name = Debug; 450 | }; 451 | F517F3BD1E0929A400DCC658 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | DEVELOPMENT_TEAM = R494QZ4GU8; 456 | INFOPLIST_FILE = ShadowTableViewGroupDemo/Info.plist; 457 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemo; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | }; 462 | name = Release; 463 | }; 464 | F517F3BF1E0929A400DCC658 /* Debug */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | BUNDLE_LOADER = "$(TEST_HOST)"; 468 | DEVELOPMENT_TEAM = R494QZ4GU8; 469 | INFOPLIST_FILE = ShadowTableViewGroupDemoTests/Info.plist; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemoTests; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShadowTableViewGroupDemo.app/ShadowTableViewGroupDemo"; 474 | }; 475 | name = Debug; 476 | }; 477 | F517F3C01E0929A400DCC658 /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | BUNDLE_LOADER = "$(TEST_HOST)"; 481 | DEVELOPMENT_TEAM = R494QZ4GU8; 482 | INFOPLIST_FILE = ShadowTableViewGroupDemoTests/Info.plist; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 484 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemoTests; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShadowTableViewGroupDemo.app/ShadowTableViewGroupDemo"; 487 | }; 488 | name = Release; 489 | }; 490 | F517F3C21E0929A400DCC658 /* Debug */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | DEVELOPMENT_TEAM = R494QZ4GU8; 494 | INFOPLIST_FILE = ShadowTableViewGroupDemoUITests/Info.plist; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 496 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemoUITests; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | TEST_TARGET_NAME = ShadowTableViewGroupDemo; 499 | }; 500 | name = Debug; 501 | }; 502 | F517F3C31E0929A400DCC658 /* Release */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | DEVELOPMENT_TEAM = R494QZ4GU8; 506 | INFOPLIST_FILE = ShadowTableViewGroupDemoUITests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = hwm.ShadowTableViewGroupDemoUITests; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TEST_TARGET_NAME = ShadowTableViewGroupDemo; 511 | }; 512 | name = Release; 513 | }; 514 | /* End XCBuildConfiguration section */ 515 | 516 | /* Begin XCConfigurationList section */ 517 | F517F3891E0929A400DCC658 /* Build configuration list for PBXProject "ShadowTableViewGroupDemo" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | F517F3B91E0929A400DCC658 /* Debug */, 521 | F517F3BA1E0929A400DCC658 /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | F517F3BB1E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemo" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | F517F3BC1E0929A400DCC658 /* Debug */, 530 | F517F3BD1E0929A400DCC658 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | }; 534 | F517F3BE1E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemoTests" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | F517F3BF1E0929A400DCC658 /* Debug */, 538 | F517F3C01E0929A400DCC658 /* Release */, 539 | ); 540 | defaultConfigurationIsVisible = 0; 541 | }; 542 | F517F3C11E0929A400DCC658 /* Build configuration list for PBXNativeTarget "ShadowTableViewGroupDemoUITests" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | F517F3C21E0929A400DCC658 /* Debug */, 546 | F517F3C31E0929A400DCC658 /* Release */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | }; 550 | /* End XCConfigurationList section */ 551 | }; 552 | rootObject = F517F3861E0929A400DCC658 /* Project object */; 553 | } 554 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. 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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. 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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/Assets.xcassets/icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/Assets.xcassets/icon.imageset/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BabyWong/tableviewSection-/1551fde99c50567c99a02ef8c7cf8346eca681f4/ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/Assets.xcassets/icon.imageset/icon@2x.png -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/GroupShadowTableView/GroupShadowTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GroupShadowTableView.h 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on qq: 1029621025. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GroupShadowTableView; 12 | @protocol GroupShadowTableViewDelegate 13 | 14 | @optional 15 | - (void)groupShadowTableView:(GroupShadowTableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; 16 | 17 | - (CGFloat)groupShadowTableView:(GroupShadowTableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; 18 | 19 | - (BOOL)groupShadowTableView:(GroupShadowTableView *)tableView canSelectAtSection:(NSInteger)section; 20 | 21 | @end 22 | 23 | @protocol GroupShadowTableViewDataSource 24 | @optional 25 | - (NSInteger)numberOfSectionsInGroupShadowTableView:(GroupShadowTableView *)tableView; 26 | 27 | @required 28 | 29 | - (NSInteger)groupShadowTableView:(GroupShadowTableView *)tableView numberOfRowsInSection:(NSInteger)section; 30 | 31 | - (UITableViewCell *)groupShadowTableView:(GroupShadowTableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 32 | 33 | @end 34 | 35 | @interface GroupShadowTableView : UITableView 36 | /** 37 | 是否显示分割线 默认YES 38 | */ 39 | @property (nonatomic,assign) BOOL showSeparator; 40 | 41 | @property (nonatomic,weak) IBOutlet id groupShadowDelegate; 42 | 43 | @property (nonatomic,weak) IBOutlet id groupShadowDataSource; 44 | 45 | @property (nonatomic,copy) NSInteger (^numberOfSectionsInGroupShadowTableView)(GroupShadowTableView *tableView); 46 | 47 | @property (nonatomic,copy) NSInteger (^numberOfRowsInSection)(GroupShadowTableView *tableView,NSInteger section); 48 | 49 | @property (nonatomic,copy) CGFloat (^heightForRowAtIndexPath)(GroupShadowTableView *tableView,NSIndexPath *indexPath); 50 | 51 | @property (nonatomic,copy) UITableViewCell * (^cellForRowAtIndexPath)(GroupShadowTableView *tableView,NSIndexPath *indexPath); 52 | 53 | @property (nonatomic,copy) void (^didSelectRowAtIndexPath)(GroupShadowTableView *tableView,NSIndexPath *indexPath); 54 | 55 | @end 56 | 57 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/GroupShadowTableView/GroupShadowTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GroupShadowTableView.m 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | 10 | #import "GroupShadowTableView.h" 11 | 12 | 13 | @interface UIView (Add) 14 | 15 | - (void)setCornerRadius:(CGFloat)radius withShadow:(BOOL)shadow withOpacity:(CGFloat)opacity; 16 | 17 | @end 18 | 19 | @implementation UIView (Add) 20 | 21 | 22 | - (void)setCornerRadius:(CGFloat)radius withShadow:(BOOL)shadow withOpacity:(CGFloat)opacity { 23 | self.layer.cornerRadius = radius; 24 | if (shadow) { 25 | self.layer.shadowColor = [UIColor lightGrayColor].CGColor; 26 | self.layer.shadowOpacity = opacity; 27 | self.layer.shadowOffset = CGSizeMake(-4, 4); 28 | self.layer.shadowRadius = 4; 29 | self.layer.shouldRasterize = NO; 30 | self.layer.shadowPath = [[UIBezierPath bezierPathWithRoundedRect:[self bounds] cornerRadius:radius] CGPath]; 31 | } 32 | self.layer.masksToBounds = !shadow; 33 | } 34 | 35 | 36 | @end 37 | 38 | @class PlainTableViewCell; 39 | @protocol PlainTableViewCellDelegate 40 | 41 | - (NSInteger)plainTableViewCell:(PlainTableViewCell *)cell numberOfRowsInSection:(NSInteger)section; 42 | 43 | - (CGFloat)plainTableViewCell:(PlainTableViewCell *)cell heightForRowAtIndexPath:(NSIndexPath *)indexPath; 44 | 45 | - (UITableViewCell *)plainTableViewCell:(PlainTableViewCell *)cell cellForRowAtIndexPath:(NSIndexPath *)indexPath; 46 | 47 | @end 48 | 49 | @interface PlainTableViewCell : UITableViewCell 50 | 51 | @property (nonatomic,weak,nullable) id delegate; 52 | 53 | @property (nonatomic,assign) BOOL showSeparator; 54 | 55 | @property (nonatomic,strong) UITableView *tableView; 56 | 57 | @property (nonatomic,copy) NSInteger (^numberOfRowsInSection)(PlainTableViewCell *plainCell,NSInteger section); 58 | 59 | @property (nonatomic,copy) UITableViewCell * (^cellForRowAtIndexPath)(PlainTableViewCell *plainCell,NSIndexPath *indexPath); 60 | 61 | @property (nonatomic,copy) CGFloat (^heightForRowAtIndexPath)(PlainTableViewCell *plainCell,NSIndexPath *indexPath); 62 | 63 | @property (nonatomic,copy) void (^didSelectRowAtIndexPath)(PlainTableViewCell *plainCell,NSIndexPath *indexPath); 64 | 65 | - (void)deselectCell; 66 | 67 | - (void)selectCell:(NSInteger)row; 68 | 69 | @end 70 | 71 | @interface GroupShadowTableView () 72 | 73 | @property (nonatomic,weak) PlainTableViewCell *selectedCell; 74 | 75 | @property (nonatomic,strong) NSIndexPath *selectedIndexPath; 76 | 77 | @end 78 | 79 | @implementation GroupShadowTableView 80 | 81 | - (instancetype)initWithFrame:(CGRect)frame 82 | { 83 | self = [super initWithFrame:frame]; 84 | if (self) { 85 | [self initializeUI]; 86 | } 87 | return self; 88 | } 89 | 90 | - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style { 91 | self = [super initWithFrame:frame style:style]; 92 | if (self) { 93 | [self initializeUI]; 94 | } 95 | return self; 96 | } 97 | 98 | - (instancetype)initWithCoder:(NSCoder *)coder 99 | { 100 | self = [super initWithCoder:coder]; 101 | if (self) { 102 | [self initializeUI]; 103 | } 104 | return self; 105 | } 106 | 107 | -(void)initializeUI { 108 | [self registerClass:[PlainTableViewCell class] forCellReuseIdentifier:@"PlainTableViewCell"]; 109 | self.delegate = self; 110 | self.dataSource = self; 111 | } 112 | 113 | - (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated { 114 | PlainTableViewCell *cell = [self cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:indexPath.section]]; 115 | [cell.tableView deselectRowAtIndexPath:[NSIndexPath indexPathForRow:indexPath.row inSection:0] animated:animated]; 116 | } 117 | 118 | //MARK: - UITableViewDataSource 119 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 120 | if (self.numberOfSectionsInGroupShadowTableView) { 121 | return self.numberOfSectionsInGroupShadowTableView(self); 122 | }else if (self.groupShadowDataSource && [self.groupShadowDataSource respondsToSelector:@selector(numberOfSectionsInGroupShadowTableView:)]) { 123 | return [self.groupShadowDataSource numberOfSectionsInGroupShadowTableView:self]; 124 | } 125 | return 0; 126 | } 127 | 128 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 129 | return 1; 130 | } 131 | 132 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 133 | PlainTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PlainTableViewCell"]; 134 | cell.showSeparator = self.showSeparator; 135 | cell.tableView.separatorInset = self.separatorInset; 136 | if (self.groupShadowDelegate && [self.groupShadowDelegate respondsToSelector:@selector(groupShadowTableView:canSelectAtSection:)]) { 137 | cell.tableView.allowsSelection = [self.groupShadowDelegate groupShadowTableView:self canSelectAtSection:indexPath.section]; 138 | }else { 139 | cell.tableView.allowsSelection = self.allowsSelection; 140 | } 141 | cell.tag = indexPath.section + 100; //标记是第几组 142 | __weak typeof(self) weakSelf = self; 143 | [cell setNumberOfRowsInSection:^NSInteger(PlainTableViewCell *plainTableViewCell, NSInteger section) { 144 | if (weakSelf.numberOfRowsInSection) { 145 | return weakSelf.numberOfRowsInSection(weakSelf,section); 146 | }else if (weakSelf.groupShadowDataSource && [weakSelf.groupShadowDataSource respondsToSelector:@selector(groupShadowTableView:numberOfRowsInSection:)]) { 147 | return [weakSelf.groupShadowDataSource groupShadowTableView:weakSelf numberOfRowsInSection:section]; 148 | } 149 | return 0; 150 | }]; 151 | 152 | [cell setHeightForRowAtIndexPath:^CGFloat(PlainTableViewCell *plainTableViewCell, NSIndexPath *indexPath) { 153 | NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:indexPath.row inSection:plainTableViewCell.tag - 100]; 154 | if (weakSelf.heightForRowAtIndexPath) { 155 | return weakSelf.heightForRowAtIndexPath(weakSelf,newIndexPath); 156 | }else if (weakSelf.groupShadowDelegate && [weakSelf.groupShadowDelegate respondsToSelector:@selector(groupShadowTableView:heightForRowAtIndexPath:)]) { 157 | return [weakSelf.groupShadowDelegate groupShadowTableView:weakSelf heightForRowAtIndexPath:newIndexPath]; 158 | } 159 | return 0; 160 | }]; 161 | 162 | [cell setCellForRowAtIndexPath:^UITableViewCell *(PlainTableViewCell *plainTableViewCell, NSIndexPath *indexPath) { 163 | NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:indexPath.row inSection:plainTableViewCell.tag - 100]; 164 | if (weakSelf.cellForRowAtIndexPath) { 165 | return weakSelf.cellForRowAtIndexPath(weakSelf,newIndexPath); 166 | }else if (weakSelf.groupShadowDataSource && [weakSelf.groupShadowDataSource respondsToSelector:@selector(groupShadowTableView:cellForRowAtIndexPath:)]) { 167 | return [weakSelf.groupShadowDataSource groupShadowTableView:weakSelf cellForRowAtIndexPath:newIndexPath]; 168 | } 169 | return nil; 170 | }]; 171 | 172 | [cell setDidSelectRowAtIndexPath:^(PlainTableViewCell *plainTableViewCell, NSIndexPath *indexPath) { 173 | 174 | NSInteger actualSection = plainTableViewCell.tag - 100; 175 | NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:indexPath.row inSection:actualSection]; 176 | if (weakSelf.selectedCell && weakSelf.selectedCell != plainTableViewCell) { 177 | [weakSelf.selectedCell deselectCell]; 178 | } 179 | if (weakSelf.didSelectRowAtIndexPath) { 180 | weakSelf.didSelectRowAtIndexPath(weakSelf,newIndexPath); 181 | }else if (weakSelf.groupShadowDelegate && [weakSelf.groupShadowDelegate respondsToSelector:@selector(groupShadowTableView:didSelectRowAtIndexPath:)]) { 182 | [weakSelf.groupShadowDelegate groupShadowTableView:weakSelf didSelectRowAtIndexPath:newIndexPath]; 183 | } 184 | self.selectedIndexPath = [NSIndexPath indexPathForRow:indexPath.row inSection:actualSection]; 185 | self.selectedCell = plainTableViewCell; 186 | }]; 187 | return cell; 188 | } 189 | 190 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 191 | PlainTableViewCell *ptCell = (PlainTableViewCell *)cell; 192 | [ptCell.tableView reloadData]; 193 | if (indexPath.section == self.selectedIndexPath.section) { 194 | [self.selectedCell selectCell:self.selectedIndexPath.row]; 195 | } 196 | } 197 | 198 | //MARK: - UITableViewDelegate 199 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 200 | 201 | NSInteger totalRows = 0; 202 | if (self.numberOfRowsInSection) { 203 | totalRows = self.numberOfRowsInSection(self,indexPath.section); 204 | }else if (self.groupShadowDataSource && [self.groupShadowDataSource respondsToSelector:@selector(groupShadowTableView:numberOfRowsInSection:)]) { 205 | totalRows = [self.groupShadowDataSource groupShadowTableView:self numberOfRowsInSection:indexPath.section]; 206 | } 207 | 208 | CGFloat totalHeight = 0; 209 | for (int i = 0; i < totalRows; i ++) { 210 | NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:i inSection:indexPath.section]; 211 | if (self.heightForRowAtIndexPath) { 212 | totalHeight += self.heightForRowAtIndexPath(self,newIndexPath); 213 | }else if (self.groupShadowDelegate && [self.groupShadowDelegate respondsToSelector:@selector(groupShadowTableView:heightForRowAtIndexPath:)]) { 214 | totalHeight += [self.groupShadowDelegate groupShadowTableView:self heightForRowAtIndexPath:newIndexPath]; 215 | } 216 | } 217 | return totalHeight; 218 | } 219 | 220 | @end 221 | 222 | //MARK: - PlainTableViewCell 223 | @implementation PlainTableViewCell 224 | 225 | -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 226 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 227 | if (self) { 228 | 229 | self.backgroundColor = [UIColor clearColor]; 230 | self.contentView.backgroundColor = [UIColor clearColor]; 231 | self.selectionStyle = UITableViewCellSeparatorStyleNone; 232 | 233 | self.tableView = [[UITableView alloc]initWithFrame:CGRectInset(self.bounds, 15, 0) style:UITableViewStylePlain]; 234 | self.tableView.delegate = self; 235 | self.tableView.dataSource = self; 236 | self.tableView.scrollEnabled = NO; 237 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 238 | [self.contentView addSubview:self.tableView]; 239 | self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 240 | 241 | } 242 | return self; 243 | } 244 | 245 | - (void)layoutSubviews { 246 | [super layoutSubviews]; 247 | [self.tableView setCornerRadius:8 withShadow:YES withOpacity:0.6]; 248 | } 249 | 250 | //MARK: - UITableViewDataSource 251 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 252 | return 1; 253 | } 254 | 255 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 256 | if (self.numberOfRowsInSection) { 257 | return self.numberOfRowsInSection(self,self.tag-100); 258 | }else { 259 | if (self.delegate && [self.delegate respondsToSelector:@selector(plainTableViewCell:numberOfRowsInSection:)]) { 260 | return [self.delegate plainTableViewCell:self numberOfRowsInSection:self.tag -100]; 261 | } 262 | } 263 | return 0; 264 | } 265 | 266 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 267 | UITableViewCell *cell; 268 | if (self.cellForRowAtIndexPath) { 269 | cell = self.cellForRowAtIndexPath(self,indexPath); 270 | }else { 271 | if (self.delegate && [self.delegate respondsToSelector:@selector(plainTableViewCell:cellForRowAtIndexPath:)]) { 272 | cell = [self.delegate plainTableViewCell:self cellForRowAtIndexPath:indexPath]; 273 | } 274 | } 275 | NSAssert(cell, @"Cell不能为空"); 276 | return cell; 277 | } 278 | 279 | - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 280 | 281 | CGFloat cornerRadius = 8.f; 282 | cell.backgroundColor = UIColor.clearColor; 283 | 284 | CAShapeLayer *layer = [[CAShapeLayer alloc] init]; 285 | CAShapeLayer *backgroundLayer = [[CAShapeLayer alloc] init]; 286 | CGMutablePathRef pathRef = CGPathCreateMutable(); 287 | CGRect bounds = cell.bounds; 288 | 289 | NSInteger numberOfRows = 0; 290 | if (self.numberOfRowsInSection) { 291 | numberOfRows = self.numberOfRowsInSection(self,self.tag -100); 292 | } 293 | 294 | BOOL needSeparator = NO; 295 | 296 | if (indexPath.row == 0 && numberOfRows == 1) { 297 | CGPathAddRoundedRect(pathRef, nil, bounds, cornerRadius, cornerRadius); 298 | }else if (indexPath.row == 0) { 299 | // 初始起点为cell的左下角坐标 300 | CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMaxY(bounds)); 301 | CGPathAddArcToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMinY(bounds), CGRectGetMidX(bounds), CGRectGetMinY(bounds), cornerRadius); 302 | CGPathAddArcToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMinY(bounds), CGRectGetMaxX(bounds), CGRectGetMidY(bounds), cornerRadius); 303 | CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds)); 304 | 305 | needSeparator = YES; 306 | 307 | } else if (indexPath.row == numberOfRows -1) { 308 | // 初始起点为cell的左上角坐标 309 | CGPathMoveToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMinY(bounds)); 310 | CGPathAddArcToPoint(pathRef, nil, CGRectGetMinX(bounds), CGRectGetMaxY(bounds), CGRectGetMidX(bounds), CGRectGetMaxY(bounds), cornerRadius); 311 | CGPathAddArcToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds), CGRectGetMaxX(bounds), CGRectGetMidY(bounds), cornerRadius); 312 | CGPathAddLineToPoint(pathRef, nil, CGRectGetMaxX(bounds), CGRectGetMinY(bounds)); 313 | } else { 314 | CGPathAddRect(pathRef, nil, bounds); 315 | needSeparator = YES; 316 | } 317 | 318 | layer.path = pathRef; 319 | backgroundLayer.path = pathRef; 320 | CFRelease(pathRef); 321 | layer.fillColor = [UIColor whiteColor].CGColor; 322 | 323 | if (self.showSeparator && needSeparator) { 324 | CALayer *lineLayer = [[CALayer alloc] init]; 325 | CGFloat lineHeight = (1.f / [UIScreen mainScreen].scale); 326 | lineLayer.frame = CGRectMake(self.separatorInset.left, bounds.size.height - lineHeight, bounds.size.width - (self.separatorInset.left + self.separatorInset.right), lineHeight); 327 | lineLayer.backgroundColor = self.tableView.separatorColor.CGColor; 328 | [layer addSublayer:lineLayer]; 329 | } 330 | 331 | UIView *roundView = [[UIView alloc] initWithFrame:bounds]; 332 | [roundView.layer insertSublayer:layer atIndex:0]; 333 | roundView.backgroundColor = UIColor.clearColor; 334 | cell.backgroundView = roundView; 335 | 336 | UIView *selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds]; 337 | backgroundLayer.fillColor = [UIColor groupTableViewBackgroundColor].CGColor; 338 | [selectedBackgroundView.layer insertSublayer:backgroundLayer below:cell.layer]; 339 | selectedBackgroundView.backgroundColor = UIColor.clearColor; 340 | cell.selectedBackgroundView = selectedBackgroundView; 341 | } 342 | 343 | //MARK: - UITableViewDelegate 344 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 345 | if (self.didSelectRowAtIndexPath) { 346 | self.didSelectRowAtIndexPath(self,indexPath); 347 | } 348 | } 349 | 350 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 351 | if (self.heightForRowAtIndexPath) { 352 | return self.heightForRowAtIndexPath(self,indexPath); 353 | }else { 354 | if (self.delegate && [self.delegate respondsToSelector:@selector(plainTableViewCell:heightForRowAtIndexPath:)]) { 355 | return [self.delegate plainTableViewCell:self heightForRowAtIndexPath:indexPath]; 356 | } 357 | } 358 | return 0; 359 | } 360 | 361 | - (void)deselectCell { 362 | [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:NO]; 363 | } 364 | 365 | - (void)selectCell:(NSInteger)row { 366 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0]; 367 | [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; 368 | } 369 | 370 | @end 371 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/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 | 38 | 39 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "GroupShadowTableView.h" 11 | 12 | @interface ViewController () 13 | 14 | 15 | @property (nonatomic, strong) GroupShadowTableView *tableView; 16 | 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | [self setTable]; 25 | 26 | } 27 | 28 | - (void)setTable { 29 | self.tableView = [[GroupShadowTableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; 30 | self.tableView.groupShadowDelegate = self; 31 | _tableView.groupShadowDataSource = self; 32 | _tableView.showSeparator = YES; 33 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 34 | self.tableView.backgroundColor = [UIColor whiteColor]; 35 | [self.view addSubview:_tableView]; 36 | } 37 | 38 | #pragma mark delegate datasource 39 | - (NSInteger)numberOfSectionsInGroupShadowTableView:(GroupShadowTableView *)tableView { 40 | return 6; 41 | } 42 | 43 | - (NSInteger)groupShadowTableView:(GroupShadowTableView *)tableView numberOfRowsInSection:(NSInteger)section { 44 | return section; 45 | } 46 | 47 | - (UITableViewCell *)groupShadowTableView:(GroupShadowTableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 48 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellcell"]; 49 | if (!cell) { 50 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellcell"]; 51 | } 52 | 53 | cell.imageView.image = [UIImage imageNamed:@"icon"]; 54 | cell.textLabel.text = [NSString stringWithFormat:@"section=%zd, row=%zd", indexPath.section, indexPath.row]; 55 | return cell; 56 | } 57 | 58 | - (CGFloat)groupShadowTableView:(GroupShadowTableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 59 | return 50; 60 | } 61 | 62 | - (void)groupShadowTableView:(GroupShadowTableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 63 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 64 | 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ShadowTableViewGroupDemo 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. 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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemoTests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemoTests/ShadowTableViewGroupDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShadowTableViewGroupDemoTests.m 3 | // ShadowTableViewGroupDemoTests 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ShadowTableViewGroupDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ShadowTableViewGroupDemoTests 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 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemoUITests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ShadowTableViewGroupDemo/ShadowTableViewGroupDemoUITests/ShadowTableViewGroupDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShadowTableViewGroupDemoUITests.m 3 | // ShadowTableViewGroupDemoUITests 4 | // 5 | // Created by hwm on 16/12/20. 6 | // Copyright © 2016年 hwm. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ShadowTableViewGroupDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ShadowTableViewGroupDemoUITests 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 | --------------------------------------------------------------------------------