├── DrawCircleProgress.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── shlity.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── shlity.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── DrawCircleProgress.xcscheme │ └── xcschememanagement.plist ├── DrawCircleProgress ├── .DS_Store ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── WSDrawCircleProgress │ ├── DrawCircleProgressButton.h │ └── DrawCircleProgressButton.m ├── launch_image@2x.jpg └── main.m ├── DrawCircleProgressTests ├── DrawCircleProgressTests.m └── Info.plist ├── DrawCircleProgressUITests ├── DrawCircleProgressUITests.m └── Info.plist └── README.md /DrawCircleProgress.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DB1E3BE81D35D7AB003E4A84 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3BE71D35D7AB003E4A84 /* main.m */; }; 11 | DB1E3BEB1D35D7AB003E4A84 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3BEA1D35D7AB003E4A84 /* AppDelegate.m */; }; 12 | DB1E3BEE1D35D7AB003E4A84 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3BED1D35D7AB003E4A84 /* ViewController.m */; }; 13 | DB1E3BF11D35D7AB003E4A84 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DB1E3BEF1D35D7AB003E4A84 /* Main.storyboard */; }; 14 | DB1E3BF31D35D7AB003E4A84 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DB1E3BF21D35D7AB003E4A84 /* Assets.xcassets */; }; 15 | DB1E3BF61D35D7AB003E4A84 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DB1E3BF41D35D7AB003E4A84 /* LaunchScreen.storyboard */; }; 16 | DB1E3C011D35D7AB003E4A84 /* DrawCircleProgressTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3C001D35D7AB003E4A84 /* DrawCircleProgressTests.m */; }; 17 | DB1E3C0C1D35D7AB003E4A84 /* DrawCircleProgressUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3C0B1D35D7AB003E4A84 /* DrawCircleProgressUITests.m */; }; 18 | DB1E3C1C1D35E318003E4A84 /* DrawCircleProgressButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DB1E3C1B1D35E318003E4A84 /* DrawCircleProgressButton.m */; }; 19 | DB1E3C1E1D3639E9003E4A84 /* launch_image@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = DB1E3C1D1D3639E9003E4A84 /* launch_image@2x.jpg */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | DB1E3BFD1D35D7AB003E4A84 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = DB1E3BDB1D35D7AB003E4A84 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = DB1E3BE21D35D7AB003E4A84; 28 | remoteInfo = DrawCircleProgress; 29 | }; 30 | DB1E3C081D35D7AB003E4A84 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = DB1E3BDB1D35D7AB003E4A84 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = DB1E3BE21D35D7AB003E4A84; 35 | remoteInfo = DrawCircleProgress; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | DB1E3BE31D35D7AB003E4A84 /* DrawCircleProgress.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DrawCircleProgress.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | DB1E3BE71D35D7AB003E4A84 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | DB1E3BE91D35D7AB003E4A84 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | DB1E3BEA1D35D7AB003E4A84 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | DB1E3BEC1D35D7AB003E4A84 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 45 | DB1E3BED1D35D7AB003E4A84 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | DB1E3BF01D35D7AB003E4A84 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | DB1E3BF21D35D7AB003E4A84 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | DB1E3BF51D35D7AB003E4A84 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | DB1E3BF71D35D7AB003E4A84 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | DB1E3BFC1D35D7AB003E4A84 /* DrawCircleProgressTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DrawCircleProgressTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | DB1E3C001D35D7AB003E4A84 /* DrawCircleProgressTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DrawCircleProgressTests.m; sourceTree = ""; }; 52 | DB1E3C021D35D7AB003E4A84 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | DB1E3C071D35D7AB003E4A84 /* DrawCircleProgressUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DrawCircleProgressUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | DB1E3C0B1D35D7AB003E4A84 /* DrawCircleProgressUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DrawCircleProgressUITests.m; sourceTree = ""; }; 55 | DB1E3C0D1D35D7AB003E4A84 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | DB1E3C1A1D35E318003E4A84 /* DrawCircleProgressButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawCircleProgressButton.h; sourceTree = ""; }; 57 | DB1E3C1B1D35E318003E4A84 /* DrawCircleProgressButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DrawCircleProgressButton.m; sourceTree = ""; }; 58 | DB1E3C1D1D3639E9003E4A84 /* launch_image@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "launch_image@2x.jpg"; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | DB1E3BE01D35D7AB003E4A84 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | DB1E3BF91D35D7AB003E4A84 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | DB1E3C041D35D7AB003E4A84 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | DB1E3BDA1D35D7AB003E4A84 = { 87 | isa = PBXGroup; 88 | children = ( 89 | DB1E3BE51D35D7AB003E4A84 /* DrawCircleProgress */, 90 | DB1E3BFF1D35D7AB003E4A84 /* DrawCircleProgressTests */, 91 | DB1E3C0A1D35D7AB003E4A84 /* DrawCircleProgressUITests */, 92 | DB1E3BE41D35D7AB003E4A84 /* Products */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | DB1E3BE41D35D7AB003E4A84 /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | DB1E3BE31D35D7AB003E4A84 /* DrawCircleProgress.app */, 100 | DB1E3BFC1D35D7AB003E4A84 /* DrawCircleProgressTests.xctest */, 101 | DB1E3C071D35D7AB003E4A84 /* DrawCircleProgressUITests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | DB1E3BE51D35D7AB003E4A84 /* DrawCircleProgress */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | DB1E3C191D35D7FB003E4A84 /* WSDrawCircleProgress */, 110 | DB1E3BE91D35D7AB003E4A84 /* AppDelegate.h */, 111 | DB1E3BEA1D35D7AB003E4A84 /* AppDelegate.m */, 112 | DB1E3BEC1D35D7AB003E4A84 /* ViewController.h */, 113 | DB1E3BED1D35D7AB003E4A84 /* ViewController.m */, 114 | DB1E3BEF1D35D7AB003E4A84 /* Main.storyboard */, 115 | DB1E3BF21D35D7AB003E4A84 /* Assets.xcassets */, 116 | DB1E3BF41D35D7AB003E4A84 /* LaunchScreen.storyboard */, 117 | DB1E3BF71D35D7AB003E4A84 /* Info.plist */, 118 | DB1E3BE61D35D7AB003E4A84 /* Supporting Files */, 119 | ); 120 | path = DrawCircleProgress; 121 | sourceTree = ""; 122 | }; 123 | DB1E3BE61D35D7AB003E4A84 /* Supporting Files */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | DB1E3C1D1D3639E9003E4A84 /* launch_image@2x.jpg */, 127 | DB1E3BE71D35D7AB003E4A84 /* main.m */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | DB1E3BFF1D35D7AB003E4A84 /* DrawCircleProgressTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | DB1E3C001D35D7AB003E4A84 /* DrawCircleProgressTests.m */, 136 | DB1E3C021D35D7AB003E4A84 /* Info.plist */, 137 | ); 138 | path = DrawCircleProgressTests; 139 | sourceTree = ""; 140 | }; 141 | DB1E3C0A1D35D7AB003E4A84 /* DrawCircleProgressUITests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | DB1E3C0B1D35D7AB003E4A84 /* DrawCircleProgressUITests.m */, 145 | DB1E3C0D1D35D7AB003E4A84 /* Info.plist */, 146 | ); 147 | path = DrawCircleProgressUITests; 148 | sourceTree = ""; 149 | }; 150 | DB1E3C191D35D7FB003E4A84 /* WSDrawCircleProgress */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | DB1E3C1A1D35E318003E4A84 /* DrawCircleProgressButton.h */, 154 | DB1E3C1B1D35E318003E4A84 /* DrawCircleProgressButton.m */, 155 | ); 156 | path = WSDrawCircleProgress; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | DB1E3BE21D35D7AB003E4A84 /* DrawCircleProgress */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = DB1E3C101D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgress" */; 165 | buildPhases = ( 166 | DB1E3BDF1D35D7AB003E4A84 /* Sources */, 167 | DB1E3BE01D35D7AB003E4A84 /* Frameworks */, 168 | DB1E3BE11D35D7AB003E4A84 /* Resources */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | ); 174 | name = DrawCircleProgress; 175 | productName = DrawCircleProgress; 176 | productReference = DB1E3BE31D35D7AB003E4A84 /* DrawCircleProgress.app */; 177 | productType = "com.apple.product-type.application"; 178 | }; 179 | DB1E3BFB1D35D7AB003E4A84 /* DrawCircleProgressTests */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = DB1E3C131D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgressTests" */; 182 | buildPhases = ( 183 | DB1E3BF81D35D7AB003E4A84 /* Sources */, 184 | DB1E3BF91D35D7AB003E4A84 /* Frameworks */, 185 | DB1E3BFA1D35D7AB003E4A84 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | DB1E3BFE1D35D7AB003E4A84 /* PBXTargetDependency */, 191 | ); 192 | name = DrawCircleProgressTests; 193 | productName = DrawCircleProgressTests; 194 | productReference = DB1E3BFC1D35D7AB003E4A84 /* DrawCircleProgressTests.xctest */; 195 | productType = "com.apple.product-type.bundle.unit-test"; 196 | }; 197 | DB1E3C061D35D7AB003E4A84 /* DrawCircleProgressUITests */ = { 198 | isa = PBXNativeTarget; 199 | buildConfigurationList = DB1E3C161D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgressUITests" */; 200 | buildPhases = ( 201 | DB1E3C031D35D7AB003E4A84 /* Sources */, 202 | DB1E3C041D35D7AB003E4A84 /* Frameworks */, 203 | DB1E3C051D35D7AB003E4A84 /* Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | DB1E3C091D35D7AB003E4A84 /* PBXTargetDependency */, 209 | ); 210 | name = DrawCircleProgressUITests; 211 | productName = DrawCircleProgressUITests; 212 | productReference = DB1E3C071D35D7AB003E4A84 /* DrawCircleProgressUITests.xctest */; 213 | productType = "com.apple.product-type.bundle.ui-testing"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | DB1E3BDB1D35D7AB003E4A84 /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | LastUpgradeCheck = 0730; 222 | ORGANIZATIONNAME = "Moresing Inc"; 223 | TargetAttributes = { 224 | DB1E3BE21D35D7AB003E4A84 = { 225 | CreatedOnToolsVersion = 7.3.1; 226 | }; 227 | DB1E3BFB1D35D7AB003E4A84 = { 228 | CreatedOnToolsVersion = 7.3.1; 229 | TestTargetID = DB1E3BE21D35D7AB003E4A84; 230 | }; 231 | DB1E3C061D35D7AB003E4A84 = { 232 | CreatedOnToolsVersion = 7.3.1; 233 | TestTargetID = DB1E3BE21D35D7AB003E4A84; 234 | }; 235 | }; 236 | }; 237 | buildConfigurationList = DB1E3BDE1D35D7AB003E4A84 /* Build configuration list for PBXProject "DrawCircleProgress" */; 238 | compatibilityVersion = "Xcode 3.2"; 239 | developmentRegion = English; 240 | hasScannedForEncodings = 0; 241 | knownRegions = ( 242 | en, 243 | Base, 244 | ); 245 | mainGroup = DB1E3BDA1D35D7AB003E4A84; 246 | productRefGroup = DB1E3BE41D35D7AB003E4A84 /* Products */; 247 | projectDirPath = ""; 248 | projectRoot = ""; 249 | targets = ( 250 | DB1E3BE21D35D7AB003E4A84 /* DrawCircleProgress */, 251 | DB1E3BFB1D35D7AB003E4A84 /* DrawCircleProgressTests */, 252 | DB1E3C061D35D7AB003E4A84 /* DrawCircleProgressUITests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | DB1E3BE11D35D7AB003E4A84 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | DB1E3BF61D35D7AB003E4A84 /* LaunchScreen.storyboard in Resources */, 263 | DB1E3C1E1D3639E9003E4A84 /* launch_image@2x.jpg in Resources */, 264 | DB1E3BF31D35D7AB003E4A84 /* Assets.xcassets in Resources */, 265 | DB1E3BF11D35D7AB003E4A84 /* Main.storyboard in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | DB1E3BFA1D35D7AB003E4A84 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | DB1E3C051D35D7AB003E4A84 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXResourcesBuildPhase section */ 284 | 285 | /* Begin PBXSourcesBuildPhase section */ 286 | DB1E3BDF1D35D7AB003E4A84 /* Sources */ = { 287 | isa = PBXSourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | DB1E3BEE1D35D7AB003E4A84 /* ViewController.m in Sources */, 291 | DB1E3BEB1D35D7AB003E4A84 /* AppDelegate.m in Sources */, 292 | DB1E3BE81D35D7AB003E4A84 /* main.m in Sources */, 293 | DB1E3C1C1D35E318003E4A84 /* DrawCircleProgressButton.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | DB1E3BF81D35D7AB003E4A84 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | DB1E3C011D35D7AB003E4A84 /* DrawCircleProgressTests.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | DB1E3C031D35D7AB003E4A84 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | DB1E3C0C1D35D7AB003E4A84 /* DrawCircleProgressUITests.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | DB1E3BFE1D35D7AB003E4A84 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = DB1E3BE21D35D7AB003E4A84 /* DrawCircleProgress */; 319 | targetProxy = DB1E3BFD1D35D7AB003E4A84 /* PBXContainerItemProxy */; 320 | }; 321 | DB1E3C091D35D7AB003E4A84 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = DB1E3BE21D35D7AB003E4A84 /* DrawCircleProgress */; 324 | targetProxy = DB1E3C081D35D7AB003E4A84 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin PBXVariantGroup section */ 329 | DB1E3BEF1D35D7AB003E4A84 /* Main.storyboard */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | DB1E3BF01D35D7AB003E4A84 /* Base */, 333 | ); 334 | name = Main.storyboard; 335 | sourceTree = ""; 336 | }; 337 | DB1E3BF41D35D7AB003E4A84 /* LaunchScreen.storyboard */ = { 338 | isa = PBXVariantGroup; 339 | children = ( 340 | DB1E3BF51D35D7AB003E4A84 /* Base */, 341 | ); 342 | name = LaunchScreen.storyboard; 343 | sourceTree = ""; 344 | }; 345 | /* End PBXVariantGroup section */ 346 | 347 | /* Begin XCBuildConfiguration section */ 348 | DB1E3C0E1D35D7AB003E4A84 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_ANALYZER_NONNULL = YES; 353 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 354 | CLANG_CXX_LIBRARY = "libc++"; 355 | CLANG_ENABLE_MODULES = YES; 356 | CLANG_ENABLE_OBJC_ARC = YES; 357 | CLANG_WARN_BOOL_CONVERSION = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 360 | CLANG_WARN_EMPTY_BODY = YES; 361 | CLANG_WARN_ENUM_CONVERSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 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 | DEBUG_INFORMATION_FORMAT = dwarf; 369 | ENABLE_STRICT_OBJC_MSGSEND = YES; 370 | ENABLE_TESTABILITY = YES; 371 | GCC_C_LANGUAGE_STANDARD = gnu99; 372 | GCC_DYNAMIC_NO_PIC = NO; 373 | GCC_NO_COMMON_BLOCKS = YES; 374 | GCC_OPTIMIZATION_LEVEL = 0; 375 | GCC_PREPROCESSOR_DEFINITIONS = ( 376 | "DEBUG=1", 377 | "$(inherited)", 378 | ); 379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 380 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 381 | GCC_WARN_UNDECLARED_SELECTOR = YES; 382 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 383 | GCC_WARN_UNUSED_FUNCTION = YES; 384 | GCC_WARN_UNUSED_VARIABLE = YES; 385 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 386 | MTL_ENABLE_DEBUG_INFO = YES; 387 | ONLY_ACTIVE_ARCH = YES; 388 | SDKROOT = iphoneos; 389 | }; 390 | name = Debug; 391 | }; 392 | DB1E3C0F1D35D7AB003E4A84 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 413 | ENABLE_NS_ASSERTIONS = NO; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_NO_COMMON_BLOCKS = YES; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 424 | MTL_ENABLE_DEBUG_INFO = NO; 425 | SDKROOT = iphoneos; 426 | VALIDATE_PRODUCT = YES; 427 | }; 428 | name = Release; 429 | }; 430 | DB1E3C111D35D7AB003E4A84 /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 434 | INFOPLIST_FILE = DrawCircleProgress/Info.plist; 435 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgress; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | }; 440 | name = Debug; 441 | }; 442 | DB1E3C121D35D7AB003E4A84 /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 446 | INFOPLIST_FILE = DrawCircleProgress/Info.plist; 447 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgress; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | }; 452 | name = Release; 453 | }; 454 | DB1E3C141D35D7AB003E4A84 /* Debug */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | BUNDLE_LOADER = "$(TEST_HOST)"; 458 | INFOPLIST_FILE = DrawCircleProgressTests/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgressTests; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DrawCircleProgress.app/DrawCircleProgress"; 463 | }; 464 | name = Debug; 465 | }; 466 | DB1E3C151D35D7AB003E4A84 /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | BUNDLE_LOADER = "$(TEST_HOST)"; 470 | INFOPLIST_FILE = DrawCircleProgressTests/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 472 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgressTests; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DrawCircleProgress.app/DrawCircleProgress"; 475 | }; 476 | name = Release; 477 | }; 478 | DB1E3C171D35D7AB003E4A84 /* Debug */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | INFOPLIST_FILE = DrawCircleProgressUITests/Info.plist; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgressUITests; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | TEST_TARGET_NAME = DrawCircleProgress; 486 | }; 487 | name = Debug; 488 | }; 489 | DB1E3C181D35D7AB003E4A84 /* Release */ = { 490 | isa = XCBuildConfiguration; 491 | buildSettings = { 492 | INFOPLIST_FILE = DrawCircleProgressUITests/Info.plist; 493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 494 | PRODUCT_BUNDLE_IDENTIFIER = com.zhimore.moresing.DrawCircleProgressUITests; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | TEST_TARGET_NAME = DrawCircleProgress; 497 | }; 498 | name = Release; 499 | }; 500 | /* End XCBuildConfiguration section */ 501 | 502 | /* Begin XCConfigurationList section */ 503 | DB1E3BDE1D35D7AB003E4A84 /* Build configuration list for PBXProject "DrawCircleProgress" */ = { 504 | isa = XCConfigurationList; 505 | buildConfigurations = ( 506 | DB1E3C0E1D35D7AB003E4A84 /* Debug */, 507 | DB1E3C0F1D35D7AB003E4A84 /* Release */, 508 | ); 509 | defaultConfigurationIsVisible = 0; 510 | defaultConfigurationName = Release; 511 | }; 512 | DB1E3C101D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgress" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | DB1E3C111D35D7AB003E4A84 /* Debug */, 516 | DB1E3C121D35D7AB003E4A84 /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | }; 520 | DB1E3C131D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgressTests" */ = { 521 | isa = XCConfigurationList; 522 | buildConfigurations = ( 523 | DB1E3C141D35D7AB003E4A84 /* Debug */, 524 | DB1E3C151D35D7AB003E4A84 /* Release */, 525 | ); 526 | defaultConfigurationIsVisible = 0; 527 | }; 528 | DB1E3C161D35D7AB003E4A84 /* Build configuration list for PBXNativeTarget "DrawCircleProgressUITests" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | DB1E3C171D35D7AB003E4A84 /* Debug */, 532 | DB1E3C181D35D7AB003E4A84 /* Release */, 533 | ); 534 | defaultConfigurationIsVisible = 0; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = DB1E3BDB1D35D7AB003E4A84 /* Project object */; 539 | } 540 | -------------------------------------------------------------------------------- /DrawCircleProgress.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DrawCircleProgress.xcodeproj/project.xcworkspace/xcuserdata/shlity.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amber01/WSDrawCircleProgress/79c4820cfde51e008a068ac3bb72166a99cc6111/DrawCircleProgress.xcodeproj/project.xcworkspace/xcuserdata/shlity.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DrawCircleProgress.xcodeproj/xcuserdata/shlity.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DrawCircleProgress.xcodeproj/xcuserdata/shlity.xcuserdatad/xcschemes/DrawCircleProgress.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 | -------------------------------------------------------------------------------- /DrawCircleProgress.xcodeproj/xcuserdata/shlity.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DrawCircleProgress.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DB1E3BE21D35D7AB003E4A84 16 | 17 | primary 18 | 19 | 20 | DB1E3BFB1D35D7AB003E4A84 21 | 22 | primary 23 | 24 | 25 | DB1E3C061D35D7AB003E4A84 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DrawCircleProgress/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amber01/WSDrawCircleProgress/79c4820cfde51e008a068ac3bb72166a99cc6111/DrawCircleProgress/.DS_Store -------------------------------------------------------------------------------- /DrawCircleProgress/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. 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 | -------------------------------------------------------------------------------- /DrawCircleProgress/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | // 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. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DrawCircleProgress/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DrawCircleProgress/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 | -------------------------------------------------------------------------------- /DrawCircleProgress/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 | -------------------------------------------------------------------------------- /DrawCircleProgress/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DrawCircleProgress/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /DrawCircleProgress/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DrawCircleProgressButton.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic,strong)UIImageView *imageView; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | [self.view addSubview:self.imageView]; 23 | 24 | DrawCircleProgressButton *drawCircleView = [[DrawCircleProgressButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width - 55, 30, 40, 40)]; 25 | drawCircleView.lineWidth = 2; 26 | [drawCircleView setTitle:@"跳过" forState:UIControlStateNormal]; 27 | [drawCircleView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 28 | drawCircleView.titleLabel.font = [UIFont systemFontOfSize:14]; 29 | 30 | [drawCircleView addTarget:self action:@selector(removeProgress) forControlEvents:UIControlEventTouchUpInside]; 31 | 32 | /** 33 | * progress 完成时候的回调 34 | */ 35 | __weak ViewController *weakSelf = self; 36 | [drawCircleView startAnimationDuration:5 withBlock:^{ 37 | [weakSelf removeProgress]; 38 | }]; 39 | 40 | [self.view addSubview:drawCircleView]; 41 | } 42 | 43 | - (void)removeProgress 44 | { 45 | self.imageView.transform = CGAffineTransformMakeScale(1, 1); 46 | self.imageView.alpha = 1; 47 | 48 | [UIView animateWithDuration:0.7 animations:^{ 49 | self.imageView.alpha = 0.05; 50 | self.imageView.transform = CGAffineTransformMakeScale(5, 5); 51 | } completion:^(BOOL finished) { 52 | 53 | [self.imageView removeFromSuperview]; 54 | 55 | }]; 56 | } 57 | 58 | - (UIImageView *)imageView 59 | { 60 | if (!_imageView) { 61 | _imageView = [[UIImageView alloc]initWithFrame:self.view.bounds]; 62 | _imageView.image = [UIImage imageNamed:@"launch_image.jpg"]; 63 | } 64 | return _imageView; 65 | } 66 | 67 | - (void)didReceiveMemoryWarning { 68 | [super didReceiveMemoryWarning]; 69 | // Dispose of any resources that can be recreated. 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /DrawCircleProgress/WSDrawCircleProgress/DrawCircleProgressButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DrawCircleProgressButton.h 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^DrawCircleProgressBlock)(void); 12 | 13 | @interface DrawCircleProgressButton : UIButton 14 | 15 | //set track color 16 | @property (nonatomic,strong)UIColor *trackColor; 17 | 18 | //set progress color 19 | @property (nonatomic,strong)UIColor *progressColor; 20 | 21 | //set track background color 22 | @property (nonatomic,strong)UIColor *fillColor; 23 | 24 | //set progress line width 25 | @property (nonatomic,assign)CGFloat lineWidth; 26 | 27 | //set progress duration 28 | @property (nonatomic,assign)CGFloat animationDuration; 29 | 30 | /** 31 | * set complete callback 32 | * 33 | * @param lineWidth line width 34 | * @param block block 35 | * @param duration time 36 | */ 37 | - (void)startAnimationDuration:(CGFloat)duration withBlock:(DrawCircleProgressBlock )block; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DrawCircleProgress/WSDrawCircleProgress/DrawCircleProgressButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // DrawCircleProgressButton.m 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import "DrawCircleProgressButton.h" 10 | 11 | #define degreesToRadians(x) ((x) * M_PI / 180.0) 12 | 13 | @interface DrawCircleProgressButton() 14 | 15 | @property (nonatomic, strong) CAShapeLayer *trackLayer; 16 | @property (nonatomic, strong) CAShapeLayer *progressLayer; 17 | @property (nonatomic, strong) UIBezierPath *bezierPath; 18 | @property (nonatomic, copy) DrawCircleProgressBlock myBlock; 19 | 20 | 21 | @end 22 | 23 | @implementation DrawCircleProgressButton 24 | 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | { 27 | if (self == [super initWithFrame:frame]) { 28 | self.backgroundColor = [UIColor clearColor]; 29 | 30 | [self.layer addSublayer:self.trackLayer]; 31 | 32 | } 33 | return self; 34 | } 35 | 36 | - (UIBezierPath *)bezierPath 37 | { 38 | if (!_bezierPath) { 39 | 40 | CGFloat width = CGRectGetWidth(self.frame)/2.0f; 41 | CGFloat height = CGRectGetHeight(self.frame)/2.0f; 42 | CGPoint centerPoint = CGPointMake(width, height); 43 | float radius = CGRectGetWidth(self.frame)/2; 44 | 45 | _bezierPath = [UIBezierPath bezierPathWithArcCenter:centerPoint 46 | radius:radius 47 | startAngle:degreesToRadians(-90) 48 | endAngle:degreesToRadians(270) 49 | clockwise:YES]; 50 | } 51 | return _bezierPath; 52 | } 53 | 54 | - (CAShapeLayer *)trackLayer 55 | { 56 | if (!_trackLayer) { 57 | _trackLayer = [CAShapeLayer layer]; 58 | _trackLayer.frame = self.bounds; 59 | _trackLayer.fillColor = self.fillColor.CGColor ? self.fillColor.CGColor : [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.3].CGColor ; 60 | _trackLayer.lineWidth = self.lineWidth ? self.lineWidth : 2.f; 61 | _trackLayer.strokeColor = self.trackColor.CGColor ? self.trackColor.CGColor : [UIColor redColor].CGColor ; 62 | _trackLayer.strokeStart = 0.f; 63 | _trackLayer.strokeEnd = 1.f; 64 | 65 | _trackLayer.path = self.bezierPath.CGPath; 66 | } 67 | return _trackLayer; 68 | } 69 | 70 | - (CAShapeLayer *)progressLayer 71 | { 72 | if (!_progressLayer) { 73 | _progressLayer = [CAShapeLayer layer]; 74 | _progressLayer.frame = self.bounds; 75 | _progressLayer.fillColor = [UIColor clearColor].CGColor; 76 | _progressLayer.lineWidth = self.lineWidth ? self.lineWidth : 2.f; 77 | _progressLayer.lineCap = kCALineCapRound; 78 | _progressLayer.strokeColor = self.progressColor.CGColor ? self.progressColor.CGColor : [UIColor grayColor].CGColor; 79 | _progressLayer.strokeStart = 0.f; 80 | 81 | CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 82 | pathAnimation.duration = self.animationDuration; 83 | pathAnimation.fromValue = @(0.0); 84 | pathAnimation.toValue = @(1.0); 85 | pathAnimation.removedOnCompletion = YES; 86 | pathAnimation.delegate = self; 87 | [_progressLayer addAnimation:pathAnimation forKey:nil]; 88 | 89 | _progressLayer.path = _bezierPath.CGPath; 90 | } 91 | return _progressLayer; 92 | } 93 | 94 | #pragma mark -- CAAnimationDelegate 95 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag 96 | { 97 | if (flag) { 98 | self.myBlock(); 99 | } 100 | } 101 | 102 | #pragma mark --- 103 | - (void)startAnimationDuration:(CGFloat)duration withBlock:(DrawCircleProgressBlock )block{ 104 | self.myBlock = block; 105 | self.animationDuration = duration; 106 | [self.layer addSublayer:self.progressLayer]; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /DrawCircleProgress/launch_image@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amber01/WSDrawCircleProgress/79c4820cfde51e008a068ac3bb72166a99cc6111/DrawCircleProgress/launch_image@2x.jpg -------------------------------------------------------------------------------- /DrawCircleProgress/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DrawCircleProgress 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. 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 | -------------------------------------------------------------------------------- /DrawCircleProgressTests/DrawCircleProgressTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DrawCircleProgressTests.m 3 | // DrawCircleProgressTests 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DrawCircleProgressTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DrawCircleProgressTests 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 | -------------------------------------------------------------------------------- /DrawCircleProgressTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DrawCircleProgressUITests/DrawCircleProgressUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DrawCircleProgressUITests.m 3 | // DrawCircleProgressUITests 4 | // 5 | // Created by shlity on 16/7/13. 6 | // Copyright © 2016年 Moresing Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DrawCircleProgressUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DrawCircleProgressUITests 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 | -------------------------------------------------------------------------------- /DrawCircleProgressUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WSDrawCircleProgress 2 | 3 | 4 | 5 | ## Overview 6 | 7 | **WSDrawCircleProgress**, 根据UIBezierPath和CAShapeLayer自定义倒计时进度条,适用于app启动的时候设置一个倒计时关闭启动页面。可以设置进度条颜色,填充颜色,进度条宽度以及点击事件等。 8 | 9 | #### 截图概述 10 | 11 | ![Mou icon](http://ww1.sinaimg.cn/mw690/63f96e20gw1f5sf589qcqg208u0g9agx.gif) 12 | 13 | #### 公共方法 14 | ```objc 15 | //set track color 16 | @property (nonatomic,strong)UIColor *trackColor; 17 | 18 | //set progress color 19 | @property (nonatomic,strong)UIColor *progressColor; 20 | 21 | //set track background color 22 | @property (nonatomic,strong)UIColor *fillColor; 23 | 24 | //set progress line width 25 | @property (nonatomic,assign)CGFloat lineWidth; 26 | 27 | //set progress duration 28 | @property (nonatomic,assign)CGFloat animationDuration; 29 | 30 | /** 31 | * set complete callback 32 | * 33 | * @param lineWidth line width 34 | * @param block block 35 | * @param duration time 36 | */ 37 | - (void)startAnimationDuration:(CGFloat)duration withBlock:(DrawCircleProgressBlock )block; 38 | 39 | ``` 40 | 41 | #### 使用 42 | ```objc 43 | - (void)viewDidLoad { 44 | [super viewDidLoad]; 45 | [self.view addSubview:self.imageView]; 46 | 47 | DrawCircleProgressButton *drawCircleView = [[DrawCircleProgressButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width - 55, 30, 40, 40)]; 48 | drawCircleView.lineWidth = 2; 49 | [drawCircleView setTitle:@"跳过" forState:UIControlStateNormal]; 50 | [drawCircleView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 51 | drawCircleView.titleLabel.font = [UIFont systemFontOfSize:14]; 52 | 53 | [drawCircleView addTarget:self action:@selector(removeProgress) forControlEvents:UIControlEventTouchUpInside]; 54 | 55 | /** 56 | * progress 完成时候的回调 57 | */ 58 | __weak ViewController *weakSelf = self; 59 | [drawCircleView startAnimationDuration:5 withBlock:^{ 60 | [weakSelf removeProgress]; 61 | }]; 62 | 63 | [self.view addSubview:drawCircleView]; 64 | } 65 | 66 | ``` 67 | --------------------------------------------------------------------------------