├── TestDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── huahua.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── huahua.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── TestDemo.xcscheme │ └── xcschememanagement.plist ├── TestDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── home_icon_meat.imageset │ │ ├── Contents.json │ │ └── home_icon_meat@2x.png │ └── list_deleting.imageset │ │ ├── Contents.json │ │ └── list_deleting@2x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── JYShopCell.h ├── JYShopCell.m ├── JYShopCell.xib ├── UIColor+HHAddition.h ├── UIColor+HHAddition.m ├── UIView+HHAddition.h ├── UIView+HHAddition.m ├── ViewController.h ├── ViewController.m └── main.m ├── TestDemoTests ├── Info.plist └── TestDemoTests.m └── TestDemoUITests ├── Info.plist └── TestDemoUITests.m /TestDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 47E0AAB71F9AE39F003C73E4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AAB61F9AE39F003C73E4 /* main.m */; }; 11 | 47E0AABA1F9AE39F003C73E4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AAB91F9AE39F003C73E4 /* AppDelegate.m */; }; 12 | 47E0AABD1F9AE39F003C73E4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AABC1F9AE39F003C73E4 /* ViewController.m */; }; 13 | 47E0AAC01F9AE39F003C73E4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 47E0AABE1F9AE39F003C73E4 /* Main.storyboard */; }; 14 | 47E0AAC21F9AE39F003C73E4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 47E0AAC11F9AE39F003C73E4 /* Assets.xcassets */; }; 15 | 47E0AAC51F9AE39F003C73E4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 47E0AAC31F9AE39F003C73E4 /* LaunchScreen.storyboard */; }; 16 | 47E0AAD01F9AE39F003C73E4 /* TestDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AACF1F9AE39F003C73E4 /* TestDemoTests.m */; }; 17 | 47E0AADB1F9AE39F003C73E4 /* TestDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AADA1F9AE39F003C73E4 /* TestDemoUITests.m */; }; 18 | 47E0AAEB1F9AE44C003C73E4 /* JYShopCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AAE91F9AE44C003C73E4 /* JYShopCell.m */; }; 19 | 47E0AAEC1F9AE44C003C73E4 /* JYShopCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47E0AAEA1F9AE44C003C73E4 /* JYShopCell.xib */; }; 20 | 47E0AAEF1F9AE4B3003C73E4 /* UIColor+HHAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AAEE1F9AE4B3003C73E4 /* UIColor+HHAddition.m */; }; 21 | 47E0AAF21F9AE4CA003C73E4 /* UIView+HHAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E0AAF11F9AE4CA003C73E4 /* UIView+HHAddition.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 47E0AACC1F9AE39F003C73E4 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 47E0AAAA1F9AE39F003C73E4 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 47E0AAB11F9AE39F003C73E4; 30 | remoteInfo = TestDemo; 31 | }; 32 | 47E0AAD71F9AE39F003C73E4 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 47E0AAAA1F9AE39F003C73E4 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 47E0AAB11F9AE39F003C73E4; 37 | remoteInfo = TestDemo; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 47E0AAB21F9AE39F003C73E4 /* TestDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 47E0AAB61F9AE39F003C73E4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 47E0AAB81F9AE39F003C73E4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 47E0AAB91F9AE39F003C73E4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 47E0AABB1F9AE39F003C73E4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 47 | 47E0AABC1F9AE39F003C73E4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 48 | 47E0AABF1F9AE39F003C73E4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 47E0AAC11F9AE39F003C73E4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 47E0AAC41F9AE39F003C73E4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 47E0AAC61F9AE39F003C73E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 47E0AACB1F9AE39F003C73E4 /* TestDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 47E0AACF1F9AE39F003C73E4 /* TestDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestDemoTests.m; sourceTree = ""; }; 54 | 47E0AAD11F9AE39F003C73E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 47E0AAD61F9AE39F003C73E4 /* TestDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 47E0AADA1F9AE39F003C73E4 /* TestDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestDemoUITests.m; sourceTree = ""; }; 57 | 47E0AADC1F9AE39F003C73E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 47E0AAE81F9AE44C003C73E4 /* JYShopCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYShopCell.h; sourceTree = ""; }; 59 | 47E0AAE91F9AE44C003C73E4 /* JYShopCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYShopCell.m; sourceTree = ""; }; 60 | 47E0AAEA1F9AE44C003C73E4 /* JYShopCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JYShopCell.xib; sourceTree = ""; }; 61 | 47E0AAED1F9AE4B3003C73E4 /* UIColor+HHAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+HHAddition.h"; sourceTree = ""; }; 62 | 47E0AAEE1F9AE4B3003C73E4 /* UIColor+HHAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+HHAddition.m"; sourceTree = ""; }; 63 | 47E0AAF01F9AE4CA003C73E4 /* UIView+HHAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+HHAddition.h"; sourceTree = ""; }; 64 | 47E0AAF11F9AE4CA003C73E4 /* UIView+HHAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+HHAddition.m"; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 47E0AAAF1F9AE39F003C73E4 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 47E0AAC81F9AE39F003C73E4 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | 47E0AAD31F9AE39F003C73E4 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | 47E0AAA91F9AE39F003C73E4 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 47E0AAB41F9AE39F003C73E4 /* TestDemo */, 96 | 47E0AACE1F9AE39F003C73E4 /* TestDemoTests */, 97 | 47E0AAD91F9AE39F003C73E4 /* TestDemoUITests */, 98 | 47E0AAB31F9AE39F003C73E4 /* Products */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | 47E0AAB31F9AE39F003C73E4 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 47E0AAB21F9AE39F003C73E4 /* TestDemo.app */, 106 | 47E0AACB1F9AE39F003C73E4 /* TestDemoTests.xctest */, 107 | 47E0AAD61F9AE39F003C73E4 /* TestDemoUITests.xctest */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | 47E0AAB41F9AE39F003C73E4 /* TestDemo */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 47E0AAB81F9AE39F003C73E4 /* AppDelegate.h */, 116 | 47E0AAB91F9AE39F003C73E4 /* AppDelegate.m */, 117 | 47E0AABB1F9AE39F003C73E4 /* ViewController.h */, 118 | 47E0AABC1F9AE39F003C73E4 /* ViewController.m */, 119 | 47E0AAED1F9AE4B3003C73E4 /* UIColor+HHAddition.h */, 120 | 47E0AAEE1F9AE4B3003C73E4 /* UIColor+HHAddition.m */, 121 | 47E0AAE81F9AE44C003C73E4 /* JYShopCell.h */, 122 | 47E0AAE91F9AE44C003C73E4 /* JYShopCell.m */, 123 | 47E0AAF01F9AE4CA003C73E4 /* UIView+HHAddition.h */, 124 | 47E0AAF11F9AE4CA003C73E4 /* UIView+HHAddition.m */, 125 | 47E0AAEA1F9AE44C003C73E4 /* JYShopCell.xib */, 126 | 47E0AABE1F9AE39F003C73E4 /* Main.storyboard */, 127 | 47E0AAC11F9AE39F003C73E4 /* Assets.xcassets */, 128 | 47E0AAC31F9AE39F003C73E4 /* LaunchScreen.storyboard */, 129 | 47E0AAC61F9AE39F003C73E4 /* Info.plist */, 130 | 47E0AAB51F9AE39F003C73E4 /* Supporting Files */, 131 | ); 132 | path = TestDemo; 133 | sourceTree = ""; 134 | }; 135 | 47E0AAB51F9AE39F003C73E4 /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 47E0AAB61F9AE39F003C73E4 /* main.m */, 139 | ); 140 | name = "Supporting Files"; 141 | sourceTree = ""; 142 | }; 143 | 47E0AACE1F9AE39F003C73E4 /* TestDemoTests */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 47E0AACF1F9AE39F003C73E4 /* TestDemoTests.m */, 147 | 47E0AAD11F9AE39F003C73E4 /* Info.plist */, 148 | ); 149 | path = TestDemoTests; 150 | sourceTree = ""; 151 | }; 152 | 47E0AAD91F9AE39F003C73E4 /* TestDemoUITests */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 47E0AADA1F9AE39F003C73E4 /* TestDemoUITests.m */, 156 | 47E0AADC1F9AE39F003C73E4 /* Info.plist */, 157 | ); 158 | path = TestDemoUITests; 159 | sourceTree = ""; 160 | }; 161 | /* End PBXGroup section */ 162 | 163 | /* Begin PBXNativeTarget section */ 164 | 47E0AAB11F9AE39F003C73E4 /* TestDemo */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 47E0AADF1F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemo" */; 167 | buildPhases = ( 168 | 47E0AAAE1F9AE39F003C73E4 /* Sources */, 169 | 47E0AAAF1F9AE39F003C73E4 /* Frameworks */, 170 | 47E0AAB01F9AE39F003C73E4 /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = TestDemo; 177 | productName = TestDemo; 178 | productReference = 47E0AAB21F9AE39F003C73E4 /* TestDemo.app */; 179 | productType = "com.apple.product-type.application"; 180 | }; 181 | 47E0AACA1F9AE39F003C73E4 /* TestDemoTests */ = { 182 | isa = PBXNativeTarget; 183 | buildConfigurationList = 47E0AAE21F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemoTests" */; 184 | buildPhases = ( 185 | 47E0AAC71F9AE39F003C73E4 /* Sources */, 186 | 47E0AAC81F9AE39F003C73E4 /* Frameworks */, 187 | 47E0AAC91F9AE39F003C73E4 /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | 47E0AACD1F9AE39F003C73E4 /* PBXTargetDependency */, 193 | ); 194 | name = TestDemoTests; 195 | productName = TestDemoTests; 196 | productReference = 47E0AACB1F9AE39F003C73E4 /* TestDemoTests.xctest */; 197 | productType = "com.apple.product-type.bundle.unit-test"; 198 | }; 199 | 47E0AAD51F9AE39F003C73E4 /* TestDemoUITests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = 47E0AAE51F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemoUITests" */; 202 | buildPhases = ( 203 | 47E0AAD21F9AE39F003C73E4 /* Sources */, 204 | 47E0AAD31F9AE39F003C73E4 /* Frameworks */, 205 | 47E0AAD41F9AE39F003C73E4 /* Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 47E0AAD81F9AE39F003C73E4 /* PBXTargetDependency */, 211 | ); 212 | name = TestDemoUITests; 213 | productName = TestDemoUITests; 214 | productReference = 47E0AAD61F9AE39F003C73E4 /* TestDemoUITests.xctest */; 215 | productType = "com.apple.product-type.bundle.ui-testing"; 216 | }; 217 | /* End PBXNativeTarget section */ 218 | 219 | /* Begin PBXProject section */ 220 | 47E0AAAA1F9AE39F003C73E4 /* Project object */ = { 221 | isa = PBXProject; 222 | attributes = { 223 | LastUpgradeCheck = 0820; 224 | ORGANIZATIONNAME = "花花"; 225 | TargetAttributes = { 226 | 47E0AAB11F9AE39F003C73E4 = { 227 | CreatedOnToolsVersion = 8.2.1; 228 | DevelopmentTeam = H5D4C54FWL; 229 | ProvisioningStyle = Automatic; 230 | }; 231 | 47E0AACA1F9AE39F003C73E4 = { 232 | CreatedOnToolsVersion = 8.2.1; 233 | DevelopmentTeam = H5D4C54FWL; 234 | ProvisioningStyle = Automatic; 235 | TestTargetID = 47E0AAB11F9AE39F003C73E4; 236 | }; 237 | 47E0AAD51F9AE39F003C73E4 = { 238 | CreatedOnToolsVersion = 8.2.1; 239 | DevelopmentTeam = H5D4C54FWL; 240 | ProvisioningStyle = Automatic; 241 | TestTargetID = 47E0AAB11F9AE39F003C73E4; 242 | }; 243 | }; 244 | }; 245 | buildConfigurationList = 47E0AAAD1F9AE39F003C73E4 /* Build configuration list for PBXProject "TestDemo" */; 246 | compatibilityVersion = "Xcode 3.2"; 247 | developmentRegion = English; 248 | hasScannedForEncodings = 0; 249 | knownRegions = ( 250 | en, 251 | Base, 252 | ); 253 | mainGroup = 47E0AAA91F9AE39F003C73E4; 254 | productRefGroup = 47E0AAB31F9AE39F003C73E4 /* Products */; 255 | projectDirPath = ""; 256 | projectRoot = ""; 257 | targets = ( 258 | 47E0AAB11F9AE39F003C73E4 /* TestDemo */, 259 | 47E0AACA1F9AE39F003C73E4 /* TestDemoTests */, 260 | 47E0AAD51F9AE39F003C73E4 /* TestDemoUITests */, 261 | ); 262 | }; 263 | /* End PBXProject section */ 264 | 265 | /* Begin PBXResourcesBuildPhase section */ 266 | 47E0AAB01F9AE39F003C73E4 /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | 47E0AAEC1F9AE44C003C73E4 /* JYShopCell.xib in Resources */, 271 | 47E0AAC51F9AE39F003C73E4 /* LaunchScreen.storyboard in Resources */, 272 | 47E0AAC21F9AE39F003C73E4 /* Assets.xcassets in Resources */, 273 | 47E0AAC01F9AE39F003C73E4 /* Main.storyboard in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 47E0AAC91F9AE39F003C73E4 /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 47E0AAD41F9AE39F003C73E4 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXResourcesBuildPhase section */ 292 | 293 | /* Begin PBXSourcesBuildPhase section */ 294 | 47E0AAAE1F9AE39F003C73E4 /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 47E0AAF21F9AE4CA003C73E4 /* UIView+HHAddition.m in Sources */, 299 | 47E0AAEB1F9AE44C003C73E4 /* JYShopCell.m in Sources */, 300 | 47E0AABD1F9AE39F003C73E4 /* ViewController.m in Sources */, 301 | 47E0AAEF1F9AE4B3003C73E4 /* UIColor+HHAddition.m in Sources */, 302 | 47E0AABA1F9AE39F003C73E4 /* AppDelegate.m in Sources */, 303 | 47E0AAB71F9AE39F003C73E4 /* main.m in Sources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | 47E0AAC71F9AE39F003C73E4 /* Sources */ = { 308 | isa = PBXSourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | 47E0AAD01F9AE39F003C73E4 /* TestDemoTests.m in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | 47E0AAD21F9AE39F003C73E4 /* Sources */ = { 316 | isa = PBXSourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 47E0AADB1F9AE39F003C73E4 /* TestDemoUITests.m in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | /* End PBXSourcesBuildPhase section */ 324 | 325 | /* Begin PBXTargetDependency section */ 326 | 47E0AACD1F9AE39F003C73E4 /* PBXTargetDependency */ = { 327 | isa = PBXTargetDependency; 328 | target = 47E0AAB11F9AE39F003C73E4 /* TestDemo */; 329 | targetProxy = 47E0AACC1F9AE39F003C73E4 /* PBXContainerItemProxy */; 330 | }; 331 | 47E0AAD81F9AE39F003C73E4 /* PBXTargetDependency */ = { 332 | isa = PBXTargetDependency; 333 | target = 47E0AAB11F9AE39F003C73E4 /* TestDemo */; 334 | targetProxy = 47E0AAD71F9AE39F003C73E4 /* PBXContainerItemProxy */; 335 | }; 336 | /* End PBXTargetDependency section */ 337 | 338 | /* Begin PBXVariantGroup section */ 339 | 47E0AABE1F9AE39F003C73E4 /* Main.storyboard */ = { 340 | isa = PBXVariantGroup; 341 | children = ( 342 | 47E0AABF1F9AE39F003C73E4 /* Base */, 343 | ); 344 | name = Main.storyboard; 345 | sourceTree = ""; 346 | }; 347 | 47E0AAC31F9AE39F003C73E4 /* LaunchScreen.storyboard */ = { 348 | isa = PBXVariantGroup; 349 | children = ( 350 | 47E0AAC41F9AE39F003C73E4 /* Base */, 351 | ); 352 | name = LaunchScreen.storyboard; 353 | sourceTree = ""; 354 | }; 355 | /* End PBXVariantGroup section */ 356 | 357 | /* Begin XCBuildConfiguration section */ 358 | 47E0AADD1F9AE39F003C73E4 /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ALWAYS_SEARCH_USER_PATHS = NO; 362 | CLANG_ANALYZER_NONNULL = YES; 363 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 364 | CLANG_CXX_LIBRARY = "libc++"; 365 | CLANG_ENABLE_MODULES = YES; 366 | CLANG_ENABLE_OBJC_ARC = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_CONSTANT_CONVERSION = YES; 369 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 370 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 371 | CLANG_WARN_EMPTY_BODY = YES; 372 | CLANG_WARN_ENUM_CONVERSION = YES; 373 | CLANG_WARN_INFINITE_RECURSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 377 | CLANG_WARN_UNREACHABLE_CODE = YES; 378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 379 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 380 | COPY_PHASE_STRIP = NO; 381 | DEBUG_INFORMATION_FORMAT = dwarf; 382 | ENABLE_STRICT_OBJC_MSGSEND = YES; 383 | ENABLE_TESTABILITY = YES; 384 | GCC_C_LANGUAGE_STANDARD = gnu99; 385 | GCC_DYNAMIC_NO_PIC = NO; 386 | GCC_NO_COMMON_BLOCKS = YES; 387 | GCC_OPTIMIZATION_LEVEL = 0; 388 | GCC_PREPROCESSOR_DEFINITIONS = ( 389 | "DEBUG=1", 390 | "$(inherited)", 391 | ); 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 399 | MTL_ENABLE_DEBUG_INFO = YES; 400 | ONLY_ACTIVE_ARCH = YES; 401 | SDKROOT = iphoneos; 402 | TARGETED_DEVICE_FAMILY = "1,2"; 403 | }; 404 | name = Debug; 405 | }; 406 | 47E0AADE1F9AE39F003C73E4 /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ALWAYS_SEARCH_USER_PATHS = NO; 410 | CLANG_ANALYZER_NONNULL = YES; 411 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 412 | CLANG_CXX_LIBRARY = "libc++"; 413 | CLANG_ENABLE_MODULES = YES; 414 | CLANG_ENABLE_OBJC_ARC = YES; 415 | CLANG_WARN_BOOL_CONVERSION = YES; 416 | CLANG_WARN_CONSTANT_CONVERSION = YES; 417 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 418 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 419 | CLANG_WARN_EMPTY_BODY = YES; 420 | CLANG_WARN_ENUM_CONVERSION = YES; 421 | CLANG_WARN_INFINITE_RECURSION = YES; 422 | CLANG_WARN_INT_CONVERSION = YES; 423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 424 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 425 | CLANG_WARN_UNREACHABLE_CODE = YES; 426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 427 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 428 | COPY_PHASE_STRIP = NO; 429 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 430 | ENABLE_NS_ASSERTIONS = NO; 431 | ENABLE_STRICT_OBJC_MSGSEND = YES; 432 | GCC_C_LANGUAGE_STANDARD = gnu99; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 435 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 436 | GCC_WARN_UNDECLARED_SELECTOR = YES; 437 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 438 | GCC_WARN_UNUSED_FUNCTION = YES; 439 | GCC_WARN_UNUSED_VARIABLE = YES; 440 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 441 | MTL_ENABLE_DEBUG_INFO = NO; 442 | SDKROOT = iphoneos; 443 | TARGETED_DEVICE_FAMILY = "1,2"; 444 | VALIDATE_PRODUCT = YES; 445 | }; 446 | name = Release; 447 | }; 448 | 47E0AAE01F9AE39F003C73E4 /* Debug */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 452 | DEVELOPMENT_TEAM = H5D4C54FWL; 453 | INFOPLIST_FILE = TestDemo/Info.plist; 454 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 456 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemo; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | }; 459 | name = Debug; 460 | }; 461 | 47E0AAE11F9AE39F003C73E4 /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 465 | DEVELOPMENT_TEAM = H5D4C54FWL; 466 | INFOPLIST_FILE = TestDemo/Info.plist; 467 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 469 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemo; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | }; 472 | name = Release; 473 | }; 474 | 47E0AAE31F9AE39F003C73E4 /* Debug */ = { 475 | isa = XCBuildConfiguration; 476 | buildSettings = { 477 | BUNDLE_LOADER = "$(TEST_HOST)"; 478 | DEVELOPMENT_TEAM = H5D4C54FWL; 479 | INFOPLIST_FILE = TestDemoTests/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemoTests; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestDemo.app/TestDemo"; 484 | }; 485 | name = Debug; 486 | }; 487 | 47E0AAE41F9AE39F003C73E4 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | BUNDLE_LOADER = "$(TEST_HOST)"; 491 | DEVELOPMENT_TEAM = H5D4C54FWL; 492 | INFOPLIST_FILE = TestDemoTests/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemoTests; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestDemo.app/TestDemo"; 497 | }; 498 | name = Release; 499 | }; 500 | 47E0AAE61F9AE39F003C73E4 /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | DEVELOPMENT_TEAM = H5D4C54FWL; 504 | INFOPLIST_FILE = TestDemoUITests/Info.plist; 505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 506 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemoUITests; 507 | PRODUCT_NAME = "$(TARGET_NAME)"; 508 | TEST_TARGET_NAME = TestDemo; 509 | }; 510 | name = Debug; 511 | }; 512 | 47E0AAE71F9AE39F003C73E4 /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | buildSettings = { 515 | DEVELOPMENT_TEAM = H5D4C54FWL; 516 | INFOPLIST_FILE = TestDemoUITests/Info.plist; 517 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 518 | PRODUCT_BUNDLE_IDENTIFIER = flower.TestDemoUITests; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | TEST_TARGET_NAME = TestDemo; 521 | }; 522 | name = Release; 523 | }; 524 | /* End XCBuildConfiguration section */ 525 | 526 | /* Begin XCConfigurationList section */ 527 | 47E0AAAD1F9AE39F003C73E4 /* Build configuration list for PBXProject "TestDemo" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 47E0AADD1F9AE39F003C73E4 /* Debug */, 531 | 47E0AADE1F9AE39F003C73E4 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | 47E0AADF1F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemo" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 47E0AAE01F9AE39F003C73E4 /* Debug */, 540 | 47E0AAE11F9AE39F003C73E4 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | }; 544 | 47E0AAE21F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemoTests" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 47E0AAE31F9AE39F003C73E4 /* Debug */, 548 | 47E0AAE41F9AE39F003C73E4 /* Release */, 549 | ); 550 | defaultConfigurationIsVisible = 0; 551 | }; 552 | 47E0AAE51F9AE39F003C73E4 /* Build configuration list for PBXNativeTarget "TestDemoUITests" */ = { 553 | isa = XCConfigurationList; 554 | buildConfigurations = ( 555 | 47E0AAE61F9AE39F003C73E4 /* Debug */, 556 | 47E0AAE71F9AE39F003C73E4 /* Release */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | }; 560 | /* End XCConfigurationList section */ 561 | }; 562 | rootObject = 47E0AAAA1F9AE39F003C73E4 /* Project object */; 563 | } 564 | -------------------------------------------------------------------------------- /TestDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TestDemo.xcodeproj/project.xcworkspace/xcuserdata/huahua.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YYDreams/TestDemo/1839614b819ceac9dfe4d23639706cffaa1cb050/TestDemo.xcodeproj/project.xcworkspace/xcuserdata/huahua.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TestDemo.xcodeproj/xcuserdata/huahua.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /TestDemo.xcodeproj/xcuserdata/huahua.xcuserdatad/xcschemes/TestDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TestDemo.xcodeproj/xcuserdata/huahua.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TestDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 47E0AAB11F9AE39F003C73E4 16 | 17 | primary 18 | 19 | 20 | 47E0AACA1F9AE39F003C73E4 21 | 22 | primary 23 | 24 | 25 | 47E0AAD51F9AE39F003C73E4 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TestDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TestDemo 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. 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 | -------------------------------------------------------------------------------- /TestDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TestDemo 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | 21 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | 24 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:[[ViewController alloc]init]]; 25 | 26 | self.window.rootViewController = nav; 27 | 28 | [self.window makeKeyAndVisible]; 29 | 30 | 31 | 32 | return YES; 33 | } 34 | 35 | 36 | - (void)applicationWillResignActive:(UIApplication *)application { 37 | // 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. 38 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 39 | } 40 | 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | // 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. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | 48 | - (void)applicationWillEnterForeground:(UIApplication *)application { 49 | // 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. 50 | } 51 | 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application { 54 | // 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. 55 | } 56 | 57 | 58 | - (void)applicationWillTerminate:(UIApplication *)application { 59 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /TestDemo/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 | } -------------------------------------------------------------------------------- /TestDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TestDemo/Assets.xcassets/home_icon_meat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_icon_meat@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 | } -------------------------------------------------------------------------------- /TestDemo/Assets.xcassets/home_icon_meat.imageset/home_icon_meat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YYDreams/TestDemo/1839614b819ceac9dfe4d23639706cffaa1cb050/TestDemo/Assets.xcassets/home_icon_meat.imageset/home_icon_meat@2x.png -------------------------------------------------------------------------------- /TestDemo/Assets.xcassets/list_deleting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "list_deleting@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 | } -------------------------------------------------------------------------------- /TestDemo/Assets.xcassets/list_deleting.imageset/list_deleting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YYDreams/TestDemo/1839614b819ceac9dfe4d23639706cffaa1cb050/TestDemo/Assets.xcassets/list_deleting.imageset/list_deleting@2x.png -------------------------------------------------------------------------------- /TestDemo/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 | -------------------------------------------------------------------------------- /TestDemo/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 | -------------------------------------------------------------------------------- /TestDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /TestDemo/JYShopCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JYShopCell.h 3 | // JYFarm 4 | // 5 | // Created by 花花 on 2017/10/16. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIColor+HHAddition.h" 11 | @interface JYShopCell : UITableViewCell 12 | 13 | 14 | @property (weak, nonatomic) IBOutlet UIButton *selBtn; 15 | @property (weak, nonatomic) IBOutlet UIImageView *imgView; 16 | 17 | @property (weak, nonatomic) IBOutlet UILabel *nameLabel; 18 | @property (weak, nonatomic) IBOutlet UILabel *priceLabel; 19 | 20 | @property (weak, nonatomic) IBOutlet UILabel *oldPriceLabel; 21 | 22 | @property (weak, nonatomic) IBOutlet UIButton *minBtn; 23 | 24 | @property (weak, nonatomic) IBOutlet UIButton *maxBtn; 25 | 26 | @property (weak, nonatomic) IBOutlet UILabel *count; 27 | 28 | @property (weak, nonatomic) IBOutlet UITextField *explainTextField; 29 | 30 | @property (weak, nonatomic) IBOutlet UIView *bordView; 31 | 32 | 33 | @property (nonatomic, copy) void (^pmBtnClick)(NSInteger tag,NSString *totalPrice); 34 | @property (nonatomic, copy) void (^selectBtnClick)(BOOL isSelecteds); 35 | @end 36 | -------------------------------------------------------------------------------- /TestDemo/JYShopCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JYShopCell.m 3 | // JYFarm 4 | // 5 | // Created by 花花 on 2017/10/16. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import "JYShopCell.h" 10 | 11 | #import "UIView+HHAddition.h" 12 | @implementation JYShopCell 13 | 14 | - (void)awakeFromNib { 15 | [super awakeFromNib]; 16 | self.minBtn.layer.borderWidth =1.0; 17 | self.minBtn.layer.borderColor = [UIColor colorWithHexString:@"62C6B2"].CGColor; 18 | self.minBtn.layer.cornerRadius = self.minBtn.frame.size.width * 0.5; 19 | 20 | 21 | 22 | self.maxBtn.layer.borderWidth =1.0; 23 | self.maxBtn.layer.borderColor = [UIColor colorWithHexString:@"62C6B2"].CGColor; 24 | self.maxBtn.layer.cornerRadius = self.maxBtn.frame.size.width * 0.5; 25 | self.maxBtn.layer.masksToBounds = YES; 26 | 27 | 28 | self.bordView.layer.borderWidth = 1; 29 | self.bordView.layer.borderColor = [UIColor colorWithHexString:@"F2F2F2"].CGColor; 30 | } 31 | 32 | //ios11该方法失效 33 | //- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index { 34 | // [super insertSubview:view atIndex:index]; 35 | // 36 | // if ([view isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")]) { 37 | // view.top = 10; 38 | // view.height = self.height - 10; 39 | // 40 | // for (UIButton *btn in view.subviews) { 41 | // 42 | // if ([btn isKindOfClass:[UIButton class]]) { 43 | // 44 | // [btn setBackgroundColor:[UIColor colorWithHexString:@"F2F2F2"]]; 45 | // 46 | // [btn setTitle:nil forState:UIControlStateNormal]; 47 | // 48 | // [btn setImage:[UIImage imageNamed:@"list_deleting"] forState:UIControlStateNormal]; 49 | // 50 | // [btn setTintColor:[UIColor whiteColor]]; 51 | // } 52 | // } 53 | // } 54 | //} 55 | 56 | 57 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 58 | [super setSelected:selected animated:animated]; 59 | 60 | 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /TestDemo/JYShopCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 82 | 88 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 117 | 127 | 137 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /TestDemo/UIColor+HHAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+HHAddition.h 3 | // Addition 4 | // 5 | // Created by 花花 on 2017/1/17. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (HHAddition) 12 | 13 | /** 14 | <#Description#> 15 | 16 | @param color 默认alpha值为1 17 | @return <#return value description#> 18 | */ 19 | + (UIColor *)colorWithHexString:(NSString *)color; 20 | 21 | 22 | //从十六进制字符串获取颜色, 23 | //color:支持@“#123456”、 @“0X123456”、 @“123456”三种格式 24 | + (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha; 25 | 26 | /** 27 | 生成随机颜色 28 | 29 | @return 随机颜色 30 | */ 31 | + (instancetype)hh_redomColor; 32 | 33 | 34 | 35 | /** 36 | 使用R/G/B 数组创建颜色 37 | 38 | @param red 红色 39 | @param green 绿色 40 | @param blue 蓝色 41 | @return 颜色 42 | */ 43 | + (instancetype)hh_colorWithRed:(uint8_t)red green:(uint8_t)green blue:(uint8_t)blue; 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /TestDemo/UIColor+HHAddition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+HHAddition.m 3 | // Addition 4 | // 5 | // Created by 花花 on 2017/1/17. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import "UIColor+HHAddition.h" 10 | 11 | @implementation UIColor (HHAddition) 12 | 13 | + (UIColor *)colorWithHexString:(NSString *)color{ 14 | 15 | return [self colorWithHexString:color alpha:1.0f]; 16 | } 17 | //从十六进制字符串获取颜色, 18 | //color:支持@“#123456”、 @“0X123456”、 @“123456”三种格式 19 | + (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha{ 20 | //删除字符串中的空格 21 | NSString *cString = [[color 22 | stringByTrimmingCharactersInSet:[NSCharacterSet 23 | whitespaceAndNewlineCharacterSet]] 24 | uppercaseString]; 25 | // String should be 6 or 8 characters 26 | if ([cString length] < 6) { 27 | return [UIColor clearColor]; 28 | } 29 | // strip 0X if it appears 30 | //如果是0x开头的,那么截取字符串,字符串从索引为2的位置开始,一直到末尾 31 | if ([cString hasPrefix:@"0X"]) { 32 | cString = [cString substringFromIndex:2]; 33 | } 34 | //如果是#开头的,那么截取字符串,字符串从索引为1的位置开始,一直到末尾 35 | if ([cString hasPrefix:@"#"]) { 36 | cString = [cString substringFromIndex:1]; 37 | } 38 | if ([cString length] != 6) { 39 | return [UIColor clearColor]; 40 | } 41 | 42 | // Separate into r, g, b substrings 43 | NSRange range; 44 | range.location = 0; 45 | range.length = 2; 46 | // r 47 | NSString *rString = [cString substringWithRange:range]; 48 | // g 49 | range.location = 2; 50 | NSString *gString = [cString substringWithRange:range]; 51 | // b 52 | range.location = 4; 53 | NSString *bString = [cString substringWithRange:range]; 54 | 55 | // Scan values 56 | unsigned int r, g, b; 57 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 58 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 59 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 60 | return [UIColor colorWithRed:((float)r / 255.0f) 61 | green:((float)g / 255.0f) 62 | blue:((float)b / 255.0f) 63 | alpha:alpha]; 64 | 65 | } 66 | 67 | 68 | /** 69 | 生成随机颜色 70 | 71 | @return 随机颜色 72 | */ 73 | + (instancetype)hh_redomColor{ 74 | 75 | return [UIColor hh_colorWithRed:arc4random_uniform(256) green:arc4random_uniform(256) blue:arc4random_uniform(256)]; 76 | 77 | 78 | } 79 | 80 | /** 81 | 使用R/G/B 数组创建颜色 82 | 83 | @param red 红色 84 | @param green 绿色 85 | @param blue 蓝色 86 | @return 颜色 87 | */ 88 | + (instancetype)hh_colorWithRed:(uint8_t)red green:(uint8_t)green blue:(uint8_t)blue{ 89 | 90 | return [UIColor colorWithRed:red / 255.0 green:green / 255.0 blue:blue / 255.0 alpha:1.0]; 91 | } 92 | 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /TestDemo/UIView+HHAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+HHAddition.h 3 | // Addition 4 | // 5 | // Created by 花花 on 2017/1/17. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (HHAddition) 12 | typedef NS_OPTIONS(NSUInteger, UIBorderSideType) { 13 | UIBorderSideTypeAll = 0, 14 | UIBorderSideTypeTop = 1 << 0, 15 | UIBorderSideTypeBottom = 1 << 1, 16 | UIBorderSideTypeLeft = 1 << 2, 17 | UIBorderSideTypeRight = 1 << 3, 18 | }; 19 | 20 | /*在分类中声明@property,只会生成方法的声明,不会生成方法的实现和带有_下划线的成员变量*/ 21 | @property (nonatomic, assign) CGPoint origin; 22 | @property(nonatomic,assign)CGSize size; 23 | @property(nonatomic,assign)CGFloat width; 24 | @property(nonatomic,assign)CGFloat height; 25 | @property(nonatomic,assign)CGFloat x; 26 | @property(nonatomic,assign)CGFloat y; 27 | @property(nonatomic,assign)CGFloat centerX; 28 | @property(nonatomic,assign)CGFloat centerY; 29 | @property(nonatomic,assign)CGFloat right; 30 | @property (nonatomic,assign) CGFloat left; 31 | @property(nonatomic,assign)CGFloat bottom; 32 | @property (nonatomic,assign) CGFloat top; 33 | 34 | 35 | @property (nonatomic,assign) CGFloat maxX; 36 | 37 | @property (nonatomic,assign) CGFloat maxY; 38 | 39 | @property (nonatomic,assign) CGFloat minX; 40 | 41 | @property (nonatomic,assign) CGFloat minY; 42 | 43 | /**判断一个空间是否是真正显示在主窗口 */ 44 | -(BOOL)isShowingOnKeyWindow; 45 | 46 | 47 | //xib加载 48 | +(instancetype)viewFromXib; 49 | 50 | // 查找子视图且不会保存 51 | //view 要查找的视图 52 | // clazzName 子控件类名 53 | /// @return 找到的第一个子视图 54 | + (UIView *)hh_foundViewInView:(UIView *)view clazzName:(NSString *)clazzName; 55 | 56 | /** 57 | ** lineView: 需要绘制成虚线的view 58 | ** lineLength: 虚线的宽度 59 | ** lineSpacing: 虚线的间距 60 | ** lineColor: 虚线的颜色 61 | **/ 62 | 63 | + (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor; 64 | 65 | 66 | - (UIView *)borderForColor:(UIColor *)color borderWidth:(CGFloat)borderWidth borderType:(UIBorderSideType)borderType; 67 | @end 68 | -------------------------------------------------------------------------------- /TestDemo/UIView+HHAddition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+HHAddition.m 3 | // Addition 4 | // 5 | // Created by 花花 on 2017/1/17. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import "UIView+HHAddition.h" 10 | 11 | @implementation UIView (HHAddition) 12 | -(void)setSize:(CGSize)size{ 13 | CGRect frame = self.frame; 14 | frame.size = size; 15 | self.frame = frame; 16 | 17 | } 18 | 19 | -(CGSize)size{ 20 | return self.frame.size; 21 | 22 | } 23 | - (CGFloat)top 24 | { 25 | return self.frame.origin.y; 26 | } 27 | 28 | 29 | - (void)setTop:(CGFloat)y 30 | { 31 | CGRect frame = self.frame; 32 | frame.origin.y = y; 33 | self.frame = frame; 34 | } 35 | - (CGFloat)left 36 | { 37 | return self.frame.origin.x; 38 | } 39 | - (void)setLeft:(CGFloat)x 40 | { 41 | CGRect frame = self.frame; 42 | frame.origin.x = x; 43 | self.frame = frame; 44 | } 45 | 46 | -(void)setWidth:(CGFloat)width{ 47 | CGRect frame = self.frame; 48 | frame.size.width =width; 49 | self.frame = frame; 50 | 51 | } 52 | -(void)setHeight:(CGFloat)height{ 53 | 54 | CGRect frame = self.frame; 55 | frame.size.height = height; 56 | self.frame =frame; 57 | 58 | 59 | } 60 | -(void)setX:(CGFloat)x{ 61 | CGRect frame = self.frame; 62 | frame.origin.x = x; 63 | self.frame = frame; 64 | 65 | } 66 | 67 | -(void)setY:(CGFloat)y{ 68 | 69 | CGRect frame = self.frame; 70 | frame.origin.y = y; 71 | self.frame = frame; 72 | } 73 | -(void)setCenterX:(CGFloat)centerX{ 74 | if (isnan(centerX)) { 75 | centerX = 0; 76 | } 77 | CGPoint center = self.center; 78 | center.x = centerX; 79 | 80 | self.center =center; 81 | } 82 | -(void)setCenterY:(CGFloat)centerY{ 83 | 84 | CGPoint center = self.center; 85 | center.y = centerY; 86 | 87 | self.center =center; 88 | 89 | 90 | } 91 | -(CGFloat)centerX{ 92 | 93 | return self.center.x; 94 | 95 | } 96 | -(CGFloat)centerY{ 97 | 98 | return self.center.y; 99 | 100 | } 101 | 102 | -(CGFloat)width{ 103 | 104 | return self.frame.size.width; 105 | 106 | } 107 | 108 | -(CGFloat)height{ 109 | 110 | return self.frame.size.height; 111 | } 112 | -(CGFloat)x{ 113 | 114 | return self.frame.origin.x; 115 | 116 | } 117 | -(CGFloat)y{ 118 | 119 | return self.frame.origin.y; 120 | } 121 | 122 | 123 | 124 | -(CGFloat)right{ 125 | 126 | return CGRectGetMaxX(self.frame); 127 | 128 | } 129 | 130 | -(void)setRight:(CGFloat)right{ 131 | 132 | self.x = right-self.width; 133 | 134 | } 135 | 136 | -(CGFloat)bottom{ 137 | 138 | return CGRectGetMaxY(self.frame); 139 | } 140 | -(void)setBottom:(CGFloat)bottom{ 141 | self.y = bottom- self.height; 142 | 143 | 144 | } 145 | /** 获取最大x */ 146 | - (CGFloat)maxX{ 147 | return self.x + self.width; 148 | } 149 | /** 获取最小x */ 150 | - (CGFloat)minX{ 151 | return self.x; 152 | } 153 | 154 | /** 获取最大y */ 155 | - (CGFloat)maxY{ 156 | return self.y + self.height; 157 | } 158 | /** 获取最小y */ 159 | - (CGFloat)minY{ 160 | return self.y; 161 | } 162 | 163 | /** 设置最小x,相当于设置x */ 164 | - (void)setMinX:(CGFloat)minX{ 165 | self.x = minX; 166 | } 167 | 168 | /** 设置最大x */ 169 | - (void)setMaxX:(CGFloat)maxX{ 170 | self.x = maxX - self.width; 171 | } 172 | 173 | /** 设置最小y,相当于设置y */ 174 | - (void)setMinY:(CGFloat)minY{ 175 | self.y = minY; 176 | } 177 | 178 | /** 设置最大y */ 179 | - (void)setMaxY:(CGFloat)maxY{ 180 | self.y = maxY - self.height; 181 | } 182 | 183 | 184 | #pragma mark - Shortcuts for frame properties 185 | 186 | - (CGPoint)origin { 187 | return self.frame.origin; 188 | } 189 | 190 | - (void)setOrigin:(CGPoint)origin { 191 | CGRect frame = self.frame; 192 | frame.origin = origin; 193 | self.frame = frame; 194 | } 195 | 196 | 197 | /**判断一个空间是否是真正显示在主窗口 */ 198 | -(BOOL)isShowingOnKeyWindow{ 199 | 200 | UIWindow *keyWindow =[UIApplication sharedApplication].keyWindow; 201 | 202 | CGRect newFrame = [keyWindow convertRect:self.frame fromView:self.superview]; 203 | 204 | CGRect winBounds = keyWindow.bounds; 205 | 206 | BOOL intersects = CGRectIntersectsRect(newFrame, winBounds); 207 | 208 | return !self.isHidden && self.alpha > 0.01 && self.window == keyWindow && intersects; 209 | 210 | 211 | } 212 | /** 213 | ** lineView: 需要绘制成虚线的view 214 | ** lineLength: 虚线的宽度 215 | ** lineSpacing: 虚线的间距 216 | ** lineColor: 虚线的颜色 217 | **/ 218 | + (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor 219 | { 220 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 221 | [shapeLayer setBounds:lineView.bounds]; 222 | [shapeLayer setPosition:CGPointMake(CGRectGetWidth(lineView.frame) / 2, CGRectGetHeight(lineView.frame))]; 223 | [shapeLayer setFillColor:[UIColor clearColor].CGColor]; 224 | // 设置虚线颜色为blackColor 225 | [shapeLayer setStrokeColor:lineColor.CGColor]; 226 | // 设置虚线宽度 227 | [shapeLayer setLineWidth:CGRectGetHeight(lineView.frame)]; 228 | [shapeLayer setLineJoin:kCALineJoinRound]; 229 | // 设置线宽,线间距 230 | [shapeLayer setLineDashPattern:[NSArray arrayWithObjects:[NSNumber numberWithInt:lineLength], [NSNumber numberWithInt:lineSpacing], nil]]; 231 | // 设置路径 232 | CGMutablePathRef path = CGPathCreateMutable(); 233 | CGPathMoveToPoint(path, NULL, 0, 0); 234 | CGPathAddLineToPoint(path, NULL, CGRectGetWidth(lineView.frame), 0); 235 | [shapeLayer setPath:path]; 236 | CGPathRelease(path); 237 | // 把绘制好的虚线添加上来 238 | [lineView.layer addSublayer:shapeLayer]; 239 | } 240 | 241 | +(instancetype)viewFromXib{ 242 | return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject]; 243 | 244 | } 245 | 246 | //输出所有子控件 247 | + (UIView *)hh_foundViewInView:(UIView *)view clazzName:(NSString *)clazzName{ 248 | 249 | // 递归出口 250 | if ([view isKindOfClass:NSClassFromString(clazzName)]) { 251 | return view; 252 | } 253 | // 遍历所有子视图 254 | for (UIView *subView in view.subviews) { 255 | UIView *foundView = [self hh_foundViewInView:subView clazzName:clazzName]; 256 | if (foundView) { 257 | return foundView; 258 | } 259 | } 260 | return nil; 261 | } 262 | 263 | - (UIView *)borderForColor:(UIColor *)color borderWidth:(CGFloat)borderWidth borderType:(UIBorderSideType)borderType { 264 | 265 | if (borderType == UIBorderSideTypeAll) { 266 | self.layer.borderWidth = borderWidth; 267 | self.layer.borderColor = color.CGColor; 268 | return self; 269 | } 270 | 271 | 272 | /// 左侧 273 | if (borderType & UIBorderSideTypeLeft) { 274 | /// 左侧线路径 275 | [self.layer addSublayer:[self addLineOriginPoint:CGPointMake(0.f, 0.f) toPoint:CGPointMake(0.0f, self.frame.size.height) color:color borderWidth:borderWidth]]; 276 | } 277 | 278 | /// 右侧 279 | if (borderType & UIBorderSideTypeRight) { 280 | /// 右侧线路径 281 | [self.layer addSublayer:[self addLineOriginPoint:CGPointMake(self.frame.size.width, 0.0f) toPoint:CGPointMake( self.frame.size.width, self.frame.size.height) color:color borderWidth:borderWidth]]; 282 | } 283 | 284 | /// top 285 | if (borderType & UIBorderSideTypeTop) { 286 | /// top线路径 287 | [self.layer addSublayer:[self addLineOriginPoint:CGPointMake(0.0f, 0.0f) toPoint:CGPointMake(self.frame.size.width, 0.0f) color:color borderWidth:borderWidth]]; 288 | } 289 | 290 | /// bottom 291 | if (borderType & UIBorderSideTypeBottom) { 292 | /// bottom线路径 293 | [self.layer addSublayer:[self addLineOriginPoint:CGPointMake(0.0f, self.frame.size.height) toPoint:CGPointMake( self.frame.size.width, self.frame.size.height) color:color borderWidth:borderWidth]]; 294 | } 295 | 296 | return self; 297 | } 298 | 299 | - (CAShapeLayer *)addLineOriginPoint:(CGPoint)p0 toPoint:(CGPoint)p1 color:(UIColor *)color borderWidth:(CGFloat)borderWidth { 300 | 301 | /// 线的路径 302 | UIBezierPath * bezierPath = [UIBezierPath bezierPath]; 303 | [bezierPath moveToPoint:p0]; 304 | [bezierPath addLineToPoint:p1]; 305 | 306 | CAShapeLayer * shapeLayer = [CAShapeLayer layer]; 307 | shapeLayer.strokeColor = color.CGColor; 308 | shapeLayer.fillColor = [UIColor clearColor].CGColor; 309 | /// 添加路径 310 | shapeLayer.path = bezierPath.CGPath; 311 | /// 线宽度 312 | shapeLayer.lineWidth = borderWidth; 313 | return shapeLayer; 314 | } 315 | 316 | @end 317 | -------------------------------------------------------------------------------- /TestDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TestDemo 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UITableViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /TestDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TestDemo 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "JYShopCell.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | static NSString *JYShopCellID = @"JYShopCellID"; 16 | @implementation ViewController 17 | 18 | #pragma mark - Life Cycle 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.title = @"购物车Test"; 23 | 24 | self.view.backgroundColor = [UIColor colorWithHexString:@"F2F2F2"]; 25 | 26 | 27 | [self setupTableView]; 28 | } 29 | 30 | //MARK: 设置左滑按钮的样式 31 | - (void)setupSlideBtnWithEditingIndexPath:(NSIndexPath *)editingIndexPath { 32 | 33 | // 判断系统是否是 iOS13 及以上版本 34 | if (@available(iOS 13.0, *)) { 35 | for (UIView *subView in self.tableView.subviews) { 36 | if ([subView isKindOfClass:NSClassFromString(@"_UITableViewCellSwipeContainerView")] && [subView.subviews count] >= 1) { 37 | // 修改图片 38 | UIView *remarkContentView = subView.subviews.firstObject; 39 | [self setupRowActionView:remarkContentView]; 40 | } 41 | } 42 | return; 43 | } 44 | 45 | // 判断系统是否是 iOS11 及以上版本 46 | if (@available(iOS 11.0, *)) { 47 | for (UIView *subView in self.tableView.subviews) { 48 | if ([subView isKindOfClass:NSClassFromString(@"UISwipeActionPullView")] && [subView.subviews count] >= 1) { 49 | // 修改图片 50 | UIView *remarkContentView = subView; 51 | [self setupRowActionView:remarkContentView]; 52 | } 53 | } 54 | return; 55 | } 56 | 57 | // iOS11 以下的版本 58 | JYShopCell *cell = [self.tableView cellForRowAtIndexPath:editingIndexPath]; 59 | for (UIView *subView in cell.subviews) { 60 | if ([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")] && [subView.subviews count] >= 1) { 61 | // 修改图片 62 | UIView *remarkContentView = subView; 63 | [self setupRowActionView:remarkContentView]; 64 | } 65 | } 66 | } 67 | 68 | - (void)setupRowActionView:(UIView *)rowActionView { 69 | // 切割圆角 70 | // [rowActionView cl_setCornerAllRadiusWithRadiu:20]; 71 | // 改变父 View 的frame,这句话是因为我在 contentView 里加了另一个 View,为了使划出的按钮能与其达到同一高度 72 | CGRect frame = rowActionView.frame; 73 | frame.origin.y += (7); 74 | frame.size.height -= (13); 75 | rowActionView.frame = frame; 76 | // 拿到按钮,设置 77 | UIButton *button = rowActionView.subviews.firstObject; 78 | [button setImage:[UIImage imageNamed:@"list_deleting"] forState:UIControlStateNormal]; 79 | [button setTitle:@"" forState:UIControlStateNormal]; 80 | } 81 | 82 | #pragma mark - setupTableView 83 | - (void)setupTableView{ 84 | 85 | [self.tableView registerNib:[UINib nibWithNibName:@"JYShopCell" bundle:nil] forCellReuseIdentifier:JYShopCellID]; 86 | self.tableView.rowHeight = 140; 87 | 88 | } 89 | #pragma mark - 90 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 91 | 92 | return 20; 93 | } 94 | 95 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 96 | 97 | JYShopCell *cell = [tableView dequeueReusableCellWithIdentifier:JYShopCellID]; 98 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 99 | cell.imgView.image =[UIImage imageNamed:@"home_icon_meat"]; 100 | cell.nameLabel.text = [NSString stringWithFormat:@"有机空心心心菜有机空心心心菜%zd",arc4random_uniform(50)]; 101 | cell.count.text = [NSString stringWithFormat:@"%zd",arc4random_uniform(44)]; 102 | cell.imgView.image = [UIImage imageNamed:@"home_icon_wine"]; 103 | cell.priceLabel.text = [NSString stringWithFormat:@"¥%zd/个",arc4random_uniform(150)]; 104 | cell.oldPriceLabel.text = [NSString stringWithFormat:@"¥%zd",arc4random_uniform(100000)]; 105 | cell.explainTextField.text = [NSString stringWithFormat:@"对菜品的说明%zd",arc4random_uniform(150)]; 106 | 107 | 108 | return cell; 109 | 110 | } 111 | 112 | - (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath{ 113 | dispatch_async(dispatch_get_main_queue(), ^{ 114 | [self setupSlideBtnWithEditingIndexPath:indexPath]; 115 | }); 116 | } 117 | 118 | 119 | 120 | - (NSArray*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(nonnull NSIndexPath *)indexPath{ 121 | //title不设为nil 而是空字符串 理由为啥 ? 自己实践 跑到ios11以下的机器上就知道为啥了 122 | UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@" " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ 123 | NSLog(@"哈哈哈哈"); 124 | [tableView setEditing:NO animated:YES]; // 这句很重要,退出编辑模式,隐藏左滑菜单 125 | }]; 126 | return @[deleteAction]; 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /TestDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestDemo 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. 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 | -------------------------------------------------------------------------------- /TestDemoTests/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 | -------------------------------------------------------------------------------- /TestDemoTests/TestDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestDemoTests.m 3 | // TestDemoTests 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TestDemoTests 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 | -------------------------------------------------------------------------------- /TestDemoUITests/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 | -------------------------------------------------------------------------------- /TestDemoUITests/TestDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestDemoUITests.m 3 | // TestDemoUITests 4 | // 5 | // Created by 花花 on 2017/10/21. 6 | // Copyright © 2017年 花花. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TestDemoUITests 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 | --------------------------------------------------------------------------------