├── .gitignore ├── .swift-version ├── Demo ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── GroupTableSeparatorFix.png ├── GroupTableSeparatorFix.podspec ├── GroupTableSeparatorFix.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── GroupTableSeparatorFix.xcscheme ├── GroupTableSeparatorFix ├── GroupTableSeparatorFix.h ├── GroupTableSeparatorFix.swift └── Info.plist ├── LICENSE └── README.md /.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 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Demo 4 | // 5 | // Created by DianQK on 27/03/2017. 6 | // Copyright © 2017 dianqk. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import GroupTableSeparatorFix 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | 19 | GroupTableSeparatorFix.removeFirstAndLastSeparatorLine() 20 | 21 | return true 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Demo/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 | } -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | GroupTableSeparatorFixDemo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.1.0 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 | -------------------------------------------------------------------------------- /Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Demo 4 | // 5 | // Created by DianQK on 27/03/2017. 6 | // Copyright © 2017 dianqk. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UITableViewController { 12 | 13 | let data: [[Int]] = [ 14 | [1, 2, 3], 15 | [4, 5, 6] 16 | ] 17 | 18 | override func numberOfSections(in tableView: UITableView) -> Int { 19 | return data.count 20 | } 21 | 22 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 23 | return data[section].count 24 | } 25 | 26 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 27 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) 28 | cell.textLabel?.text = "\(data[indexPath.section][indexPath.row])" 29 | return cell 30 | } 31 | 32 | override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 33 | return "Header" 34 | } 35 | 36 | override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { 37 | return "Footer" 38 | } 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianqk/GroupTableSeparatorFix/0f1337fdeab2035efe6bfe0b4e122f4e7f38f498/GroupTableSeparatorFix.png -------------------------------------------------------------------------------- /GroupTableSeparatorFix.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "GroupTableSeparatorFix" 3 | s.version = "0.2.0" 4 | s.summary = 'Remove your first and last separator line on grouped tableview.' 5 | s.homepage = "https://github.com/DianQK/GroupTableSeparatorFix" 6 | s.license = 'MIT' 7 | s.author = {'DianQK' => 'DianQK'} 8 | s.source = { :git => 'https://github.com/DianQK/GroupTableSeparatorFix.git', :tag => s.version.to_s } 9 | s.platform = :ios, '8.0' 10 | s.source_files = 'GroupTableSeparatorFix/GroupTableSeparatorFix.swift' 11 | s.framework = 'UIKit' 12 | end 13 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 262C2E111E892AFB00A76DEB /* GroupTableSeparatorFix.h in Headers */ = {isa = PBXBuildFile; fileRef = 262C2E0F1E892AFB00A76DEB /* GroupTableSeparatorFix.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 262C2E1E1E892B0400A76DEB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262C2E1D1E892B0400A76DEB /* AppDelegate.swift */; }; 12 | 262C2E201E892B0400A76DEB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262C2E1F1E892B0400A76DEB /* ViewController.swift */; }; 13 | 262C2E231E892B0400A76DEB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 262C2E211E892B0400A76DEB /* Main.storyboard */; }; 14 | 262C2E251E892B0500A76DEB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 262C2E241E892B0500A76DEB /* Assets.xcassets */; }; 15 | 262C2E281E892B0500A76DEB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 262C2E261E892B0500A76DEB /* LaunchScreen.storyboard */; }; 16 | 262C2E2E1E892B3600A76DEB /* GroupTableSeparatorFix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262C2E2D1E892B3600A76DEB /* GroupTableSeparatorFix.swift */; }; 17 | 262C2E2F1E892C5600A76DEB /* GroupTableSeparatorFix.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 262C2E0C1E892AFB00A76DEB /* GroupTableSeparatorFix.framework */; }; 18 | 262C2E311E892C5B00A76DEB /* GroupTableSeparatorFix.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 262C2E0C1E892AFB00A76DEB /* GroupTableSeparatorFix.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 262C2E321E892C5B00A76DEB /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 262C2E031E892AFB00A76DEB /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 262C2E0B1E892AFB00A76DEB; 27 | remoteInfo = GroupTableSeparatorFix; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXCopyFilesBuildPhase section */ 32 | 262C2E341E892C5B00A76DEB /* Embed Frameworks */ = { 33 | isa = PBXCopyFilesBuildPhase; 34 | buildActionMask = 2147483647; 35 | dstPath = ""; 36 | dstSubfolderSpec = 10; 37 | files = ( 38 | 262C2E311E892C5B00A76DEB /* GroupTableSeparatorFix.framework in Embed Frameworks */, 39 | ); 40 | name = "Embed Frameworks"; 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXCopyFilesBuildPhase section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 262C2E0C1E892AFB00A76DEB /* GroupTableSeparatorFix.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GroupTableSeparatorFix.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 262C2E0F1E892AFB00A76DEB /* GroupTableSeparatorFix.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GroupTableSeparatorFix.h; sourceTree = ""; }; 48 | 262C2E101E892AFB00A76DEB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 262C2E1B1E892B0400A76DEB /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 262C2E1D1E892B0400A76DEB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 51 | 262C2E1F1E892B0400A76DEB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 52 | 262C2E221E892B0400A76DEB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 262C2E241E892B0500A76DEB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 262C2E271E892B0500A76DEB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 262C2E291E892B0500A76DEB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 262C2E2D1E892B3600A76DEB /* GroupTableSeparatorFix.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupTableSeparatorFix.swift; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 262C2E081E892AFB00A76DEB /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 262C2E181E892B0400A76DEB /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | 262C2E2F1E892C5600A76DEB /* GroupTableSeparatorFix.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 262C2E021E892AFB00A76DEB = { 79 | isa = PBXGroup; 80 | children = ( 81 | 262C2E0E1E892AFB00A76DEB /* GroupTableSeparatorFix */, 82 | 262C2E1C1E892B0400A76DEB /* Demo */, 83 | 262C2E0D1E892AFB00A76DEB /* Products */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | 262C2E0D1E892AFB00A76DEB /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 262C2E0C1E892AFB00A76DEB /* GroupTableSeparatorFix.framework */, 91 | 262C2E1B1E892B0400A76DEB /* Demo.app */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | 262C2E0E1E892AFB00A76DEB /* GroupTableSeparatorFix */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 262C2E0F1E892AFB00A76DEB /* GroupTableSeparatorFix.h */, 100 | 262C2E101E892AFB00A76DEB /* Info.plist */, 101 | 262C2E2D1E892B3600A76DEB /* GroupTableSeparatorFix.swift */, 102 | ); 103 | path = GroupTableSeparatorFix; 104 | sourceTree = ""; 105 | }; 106 | 262C2E1C1E892B0400A76DEB /* Demo */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 262C2E1D1E892B0400A76DEB /* AppDelegate.swift */, 110 | 262C2E1F1E892B0400A76DEB /* ViewController.swift */, 111 | 262C2E211E892B0400A76DEB /* Main.storyboard */, 112 | 262C2E241E892B0500A76DEB /* Assets.xcassets */, 113 | 262C2E261E892B0500A76DEB /* LaunchScreen.storyboard */, 114 | 262C2E291E892B0500A76DEB /* Info.plist */, 115 | ); 116 | path = Demo; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXHeadersBuildPhase section */ 122 | 262C2E091E892AFB00A76DEB /* Headers */ = { 123 | isa = PBXHeadersBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | 262C2E111E892AFB00A76DEB /* GroupTableSeparatorFix.h in Headers */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 0; 129 | }; 130 | /* End PBXHeadersBuildPhase section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 262C2E0B1E892AFB00A76DEB /* GroupTableSeparatorFix */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 262C2E141E892AFB00A76DEB /* Build configuration list for PBXNativeTarget "GroupTableSeparatorFix" */; 136 | buildPhases = ( 137 | 262C2E071E892AFB00A76DEB /* Sources */, 138 | 262C2E081E892AFB00A76DEB /* Frameworks */, 139 | 262C2E091E892AFB00A76DEB /* Headers */, 140 | 262C2E0A1E892AFB00A76DEB /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = GroupTableSeparatorFix; 147 | productName = GroupTableSeparatorFix; 148 | productReference = 262C2E0C1E892AFB00A76DEB /* GroupTableSeparatorFix.framework */; 149 | productType = "com.apple.product-type.framework"; 150 | }; 151 | 262C2E1A1E892B0400A76DEB /* Demo */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 262C2E2A1E892B0500A76DEB /* Build configuration list for PBXNativeTarget "Demo" */; 154 | buildPhases = ( 155 | 262C2E171E892B0400A76DEB /* Sources */, 156 | 262C2E181E892B0400A76DEB /* Frameworks */, 157 | 262C2E191E892B0400A76DEB /* Resources */, 158 | 262C2E341E892C5B00A76DEB /* Embed Frameworks */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | 262C2E331E892C5B00A76DEB /* PBXTargetDependency */, 164 | ); 165 | name = Demo; 166 | productName = Demo; 167 | productReference = 262C2E1B1E892B0400A76DEB /* Demo.app */; 168 | productType = "com.apple.product-type.application"; 169 | }; 170 | /* End PBXNativeTarget section */ 171 | 172 | /* Begin PBXProject section */ 173 | 262C2E031E892AFB00A76DEB /* Project object */ = { 174 | isa = PBXProject; 175 | attributes = { 176 | LastSwiftUpdateCheck = 0820; 177 | LastUpgradeCheck = 0910; 178 | ORGANIZATIONNAME = dianqk; 179 | TargetAttributes = { 180 | 262C2E0B1E892AFB00A76DEB = { 181 | CreatedOnToolsVersion = 8.2.1; 182 | DevelopmentTeam = 9Y9KG3KBHJ; 183 | LastSwiftMigration = 0820; 184 | ProvisioningStyle = Manual; 185 | }; 186 | 262C2E1A1E892B0400A76DEB = { 187 | CreatedOnToolsVersion = 8.2.1; 188 | DevelopmentTeam = RML58CN62D; 189 | ProvisioningStyle = Automatic; 190 | }; 191 | }; 192 | }; 193 | buildConfigurationList = 262C2E061E892AFB00A76DEB /* Build configuration list for PBXProject "GroupTableSeparatorFix" */; 194 | compatibilityVersion = "Xcode 3.2"; 195 | developmentRegion = English; 196 | hasScannedForEncodings = 0; 197 | knownRegions = ( 198 | en, 199 | Base, 200 | ); 201 | mainGroup = 262C2E021E892AFB00A76DEB; 202 | productRefGroup = 262C2E0D1E892AFB00A76DEB /* Products */; 203 | projectDirPath = ""; 204 | projectRoot = ""; 205 | targets = ( 206 | 262C2E0B1E892AFB00A76DEB /* GroupTableSeparatorFix */, 207 | 262C2E1A1E892B0400A76DEB /* Demo */, 208 | ); 209 | }; 210 | /* End PBXProject section */ 211 | 212 | /* Begin PBXResourcesBuildPhase section */ 213 | 262C2E0A1E892AFB00A76DEB /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | 262C2E191E892B0400A76DEB /* Resources */ = { 221 | isa = PBXResourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | 262C2E281E892B0500A76DEB /* LaunchScreen.storyboard in Resources */, 225 | 262C2E251E892B0500A76DEB /* Assets.xcassets in Resources */, 226 | 262C2E231E892B0400A76DEB /* Main.storyboard in Resources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | /* End PBXResourcesBuildPhase section */ 231 | 232 | /* Begin PBXSourcesBuildPhase section */ 233 | 262C2E071E892AFB00A76DEB /* Sources */ = { 234 | isa = PBXSourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | 262C2E2E1E892B3600A76DEB /* GroupTableSeparatorFix.swift in Sources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | 262C2E171E892B0400A76DEB /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 262C2E201E892B0400A76DEB /* ViewController.swift in Sources */, 246 | 262C2E1E1E892B0400A76DEB /* AppDelegate.swift in Sources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXSourcesBuildPhase section */ 251 | 252 | /* Begin PBXTargetDependency section */ 253 | 262C2E331E892C5B00A76DEB /* PBXTargetDependency */ = { 254 | isa = PBXTargetDependency; 255 | target = 262C2E0B1E892AFB00A76DEB /* GroupTableSeparatorFix */; 256 | targetProxy = 262C2E321E892C5B00A76DEB /* PBXContainerItemProxy */; 257 | }; 258 | /* End PBXTargetDependency section */ 259 | 260 | /* Begin PBXVariantGroup section */ 261 | 262C2E211E892B0400A76DEB /* Main.storyboard */ = { 262 | isa = PBXVariantGroup; 263 | children = ( 264 | 262C2E221E892B0400A76DEB /* Base */, 265 | ); 266 | name = Main.storyboard; 267 | sourceTree = ""; 268 | }; 269 | 262C2E261E892B0500A76DEB /* LaunchScreen.storyboard */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | 262C2E271E892B0500A76DEB /* Base */, 273 | ); 274 | name = LaunchScreen.storyboard; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXVariantGroup section */ 278 | 279 | /* Begin XCBuildConfiguration section */ 280 | 262C2E121E892AFB00A76DEB /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_ANALYZER_NONNULL = YES; 285 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 286 | CLANG_CXX_LIBRARY = "libc++"; 287 | CLANG_ENABLE_MODULES = YES; 288 | CLANG_ENABLE_OBJC_ARC = YES; 289 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 290 | CLANG_WARN_BOOL_CONVERSION = YES; 291 | CLANG_WARN_COMMA = YES; 292 | CLANG_WARN_CONSTANT_CONVERSION = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 295 | CLANG_WARN_EMPTY_BODY = YES; 296 | CLANG_WARN_ENUM_CONVERSION = YES; 297 | CLANG_WARN_INFINITE_RECURSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 300 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 301 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 302 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 303 | CLANG_WARN_STRICT_PROTOTYPES = YES; 304 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | CURRENT_PROJECT_VERSION = 1; 310 | DEBUG_INFORMATION_FORMAT = dwarf; 311 | ENABLE_STRICT_OBJC_MSGSEND = YES; 312 | ENABLE_TESTABILITY = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_DYNAMIC_NO_PIC = NO; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_OPTIMIZATION_LEVEL = 0; 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 322 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 323 | GCC_WARN_UNDECLARED_SELECTOR = YES; 324 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 325 | GCC_WARN_UNUSED_FUNCTION = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 328 | MTL_ENABLE_DEBUG_INFO = YES; 329 | ONLY_ACTIVE_ARCH = YES; 330 | SDKROOT = iphoneos; 331 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 332 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 333 | TARGETED_DEVICE_FAMILY = "1,2"; 334 | VERSIONING_SYSTEM = "apple-generic"; 335 | VERSION_INFO_PREFIX = ""; 336 | }; 337 | name = Debug; 338 | }; 339 | 262C2E131E892AFB00A76DEB /* Release */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_ANALYZER_NONNULL = YES; 344 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 345 | CLANG_CXX_LIBRARY = "libc++"; 346 | CLANG_ENABLE_MODULES = YES; 347 | CLANG_ENABLE_OBJC_ARC = YES; 348 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_COMMA = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 353 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INFINITE_RECURSION = YES; 357 | CLANG_WARN_INT_CONVERSION = YES; 358 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 359 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 362 | CLANG_WARN_STRICT_PROTOTYPES = YES; 363 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 364 | CLANG_WARN_UNREACHABLE_CODE = YES; 365 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 366 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 367 | COPY_PHASE_STRIP = NO; 368 | CURRENT_PROJECT_VERSION = 1; 369 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 370 | ENABLE_NS_ASSERTIONS = NO; 371 | ENABLE_STRICT_OBJC_MSGSEND = YES; 372 | GCC_C_LANGUAGE_STANDARD = gnu99; 373 | GCC_NO_COMMON_BLOCKS = YES; 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 381 | MTL_ENABLE_DEBUG_INFO = NO; 382 | SDKROOT = iphoneos; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | VALIDATE_PRODUCT = YES; 386 | VERSIONING_SYSTEM = "apple-generic"; 387 | VERSION_INFO_PREFIX = ""; 388 | }; 389 | name = Release; 390 | }; 391 | 262C2E151E892AFB00A76DEB /* Debug */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | CLANG_ENABLE_MODULES = YES; 395 | CODE_SIGN_IDENTITY = ""; 396 | DEFINES_MODULE = YES; 397 | DEVELOPMENT_TEAM = 9Y9KG3KBHJ; 398 | DYLIB_COMPATIBILITY_VERSION = 1; 399 | DYLIB_CURRENT_VERSION = 1; 400 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 401 | INFOPLIST_FILE = GroupTableSeparatorFix/Info.plist; 402 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 404 | PRODUCT_BUNDLE_IDENTIFIER = org.dianqk.GroupTableSeparatorFix; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | SKIP_INSTALL = YES; 407 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 408 | SWIFT_VERSION = 4.0; 409 | }; 410 | name = Debug; 411 | }; 412 | 262C2E161E892AFB00A76DEB /* Release */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | CLANG_ENABLE_MODULES = YES; 416 | CODE_SIGN_IDENTITY = ""; 417 | DEFINES_MODULE = YES; 418 | DEVELOPMENT_TEAM = 9Y9KG3KBHJ; 419 | DYLIB_COMPATIBILITY_VERSION = 1; 420 | DYLIB_CURRENT_VERSION = 1; 421 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 422 | INFOPLIST_FILE = GroupTableSeparatorFix/Info.plist; 423 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 425 | PRODUCT_BUNDLE_IDENTIFIER = org.dianqk.GroupTableSeparatorFix; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SKIP_INSTALL = YES; 428 | SWIFT_VERSION = 4.0; 429 | }; 430 | name = Release; 431 | }; 432 | 262C2E2B1E892B0500A76DEB /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | DEVELOPMENT_TEAM = RML58CN62D; 438 | INFOPLIST_FILE = Demo/Info.plist; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 440 | PRODUCT_BUNDLE_IDENTIFIER = org.dianqk.Demo; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | SWIFT_VERSION = 4.0; 443 | }; 444 | name = Debug; 445 | }; 446 | 262C2E2C1E892B0500A76DEB /* Release */ = { 447 | isa = XCBuildConfiguration; 448 | buildSettings = { 449 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 450 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 451 | DEVELOPMENT_TEAM = RML58CN62D; 452 | INFOPLIST_FILE = Demo/Info.plist; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 454 | PRODUCT_BUNDLE_IDENTIFIER = org.dianqk.Demo; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | SWIFT_VERSION = 4.0; 457 | }; 458 | name = Release; 459 | }; 460 | /* End XCBuildConfiguration section */ 461 | 462 | /* Begin XCConfigurationList section */ 463 | 262C2E061E892AFB00A76DEB /* Build configuration list for PBXProject "GroupTableSeparatorFix" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 262C2E121E892AFB00A76DEB /* Debug */, 467 | 262C2E131E892AFB00A76DEB /* Release */, 468 | ); 469 | defaultConfigurationIsVisible = 0; 470 | defaultConfigurationName = Release; 471 | }; 472 | 262C2E141E892AFB00A76DEB /* Build configuration list for PBXNativeTarget "GroupTableSeparatorFix" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 262C2E151E892AFB00A76DEB /* Debug */, 476 | 262C2E161E892AFB00A76DEB /* Release */, 477 | ); 478 | defaultConfigurationIsVisible = 0; 479 | defaultConfigurationName = Release; 480 | }; 481 | 262C2E2A1E892B0500A76DEB /* Build configuration list for PBXNativeTarget "Demo" */ = { 482 | isa = XCConfigurationList; 483 | buildConfigurations = ( 484 | 262C2E2B1E892B0500A76DEB /* Debug */, 485 | 262C2E2C1E892B0500A76DEB /* Release */, 486 | ); 487 | defaultConfigurationIsVisible = 0; 488 | defaultConfigurationName = Release; 489 | }; 490 | /* End XCConfigurationList section */ 491 | }; 492 | rootObject = 262C2E031E892AFB00A76DEB /* Project object */; 493 | } 494 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix.xcodeproj/xcshareddata/xcschemes/GroupTableSeparatorFix.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 65 | 66 | 72 | 73 | 74 | 75 | 77 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix/GroupTableSeparatorFix.h: -------------------------------------------------------------------------------- 1 | // 2 | // GroupTableSeparatorFix.h 3 | // GroupTableSeparatorFix 4 | // 5 | // Created by DianQK on 27/03/2017. 6 | // Copyright © 2017 dianqk. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for GroupTableSeparatorFix. 12 | FOUNDATION_EXPORT double GroupTableSeparatorFixVersionNumber; 13 | 14 | //! Project version string for GroupTableSeparatorFix. 15 | FOUNDATION_EXPORT const unsigned char GroupTableSeparatorFixVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix/GroupTableSeparatorFix.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GroupTableSeparatorFix.swift 3 | // GroupTableSeparatorFix 4 | // 5 | // Created by DianQK on 27/03/2017. 6 | // Copyright © 2017 dianqk. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class GroupTableSeparatorFix { 12 | 13 | private static let removeFirstAndLastSeparatorLine: () = { 14 | guard let method = class_getInstanceMethod(UITableViewCell.self, #selector(UITableViewCell.layoutSubviews)), 15 | let otherMethod = class_getInstanceMethod(UITableViewCell.self, #selector(UITableViewCell.fix_layoutSubviews)) else { 16 | print("GroupTableSeparatorFix: Failure to remove first and last separator line") 17 | return 18 | } 19 | method_exchangeImplementations(method, otherMethod) 20 | return 21 | }() 22 | 23 | public class func removeFirstAndLastSeparatorLine(_: Void = ()) { 24 | _ = removeFirstAndLastSeparatorLine 25 | } 26 | 27 | } 28 | 29 | extension UITableViewCell { 30 | 31 | open var shouldRemoveFirstAndLastSeparatorLine: Bool { 32 | return true 33 | } 34 | 35 | @objc fileprivate dynamic func fix_layoutSubviews() { 36 | guard shouldRemoveFirstAndLastSeparatorLine else { 37 | self.fix_layoutSubviews() 38 | return 39 | } 40 | if separatorInset.left == 0.0 { 41 | separatorInset.left = CGFloat.leastNonzeroMagnitude 42 | } 43 | self.fix_layoutSubviews() 44 | for view in self.subviews where view != self.contentView { 45 | if view.frame.height <= 0.5 { 46 | view.isHidden = view.frame.origin.x == 0 && view.frame.width == self.frame.width 47 | } 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /GroupTableSeparatorFix/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 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 DianQK 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 | # GroupTableSeparatorFix 2 | 3 | Remove your first and last separator line on grouped tableview. 4 | 5 | ![](https://raw.githubusercontent.com/DianQK/GroupTableSeparatorFix/master/GroupTableSeparatorFix.png) 6 | 7 | ## Install 8 | 9 | ### Cocoapods 10 | 11 | ``` 12 | pod 'GroupTableSeparatorFix', '~> 0.2.0' 13 | ``` 14 | 15 | ### Carthage 16 | 17 | ``` 18 | github "DianQK/GroupTableSeparatorFix" ~> 0.2 19 | ``` 20 | 21 | ## Usage 22 | 23 | just add this code when you need: 24 | 25 | ```swift 26 | GroupTableSeparatorFix.removeFirstAndLastSeparatorLine() 27 | ``` 28 | 29 | > Don't forget `import GroupTableSeparatorFix`. 30 | 31 | ## License 32 | 33 | MIT 34 | --------------------------------------------------------------------------------