├── .DS_Store ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md └── ZXCircleProgressView ├── ZXCircleProgressView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ZXCircleProgressView ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── ZXCircleProgressViewCore │ ├── NSObject+ZXKVO.h │ ├── NSObject+ZXKVO.m │ ├── UILabel+ZXGetLabelSize.h │ ├── UILabel+ZXGetLabelSize.m │ ├── ZXCircleProgressView.h │ └── ZXCircleProgressView.m └── main.m ├── ZXCircleProgressViewTests ├── Info.plist └── ZXCircleProgressViewTests.m └── ZXCircleProgressViewUITests ├── Info.plist └── ZXCircleProgressViewUITests.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SmileZXLee/ZXCircleProgressView/2d7925e37dd854dbbb0e43580626b818f74bf961/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | # 39 | # Add this line if you want to avoid checking in source code from the Xcode workspace 40 | # *.xcworkspace 41 | 42 | # Carthage 43 | # 44 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 45 | # Carthage/Checkouts 46 | 47 | Carthage/Build 48 | 49 | # fastlane 50 | # 51 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 52 | # screenshots whenever they are needed. 53 | # For more information about the recommended setup visit: 54 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 55 | 56 | fastlane/report.xml 57 | fastlane/Preview.html 58 | fastlane/screenshots/**/*.png 59 | fastlane/test_output 60 | 61 | # Code Injection 62 | # 63 | # After new code Injection tools there's a generated folder /iOSInjectionProject 64 | # https://github.com/johnno1962/injectionforxcode 65 | 66 | iOSInjectionProject/ 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 李兆祥 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZXCircleProgressView 2 | 3 | ![Image text](http://www.zxlee.cn/ZXCircleProgressView.gif) 4 | 5 | # Demo 6 | 7 | ```objective-c 8 | - (void)viewDidLoad { 9 | [super viewDidLoad]; 10 | NSArray *titlesArr = @[@"test1",@"test2",@"test3",@"test4",@"test5"]; 11 | ZXCircleProgressView *V = [[ZXCircleProgressView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 60) titlesArr:titlesArr]; 12 | V.backgroundColor = [UIColor yellowColor]; 13 | self.progressView = V; 14 | [self.view addSubview:V]; 15 | } 16 | 17 | - (IBAction)segIndexChangeAction:(id)sender { 18 | UISegmentedControl *segV = (UISegmentedControl *)sender; 19 | self.progressView.index = segV.selectedSegmentIndex; 20 | } 21 | 22 | ``` 23 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7454334721F7FBAA0032B63B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454334621F7FBAA0032B63B /* AppDelegate.m */; }; 11 | 7454334A21F7FBAA0032B63B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454334921F7FBAA0032B63B /* ViewController.m */; }; 12 | 7454334D21F7FBAA0032B63B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7454334B21F7FBAA0032B63B /* Main.storyboard */; }; 13 | 7454334F21F7FBAA0032B63B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7454334E21F7FBAA0032B63B /* Assets.xcassets */; }; 14 | 7454335221F7FBAA0032B63B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7454335021F7FBAA0032B63B /* LaunchScreen.storyboard */; }; 15 | 7454335521F7FBAA0032B63B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454335421F7FBAA0032B63B /* main.m */; }; 16 | 7454335F21F7FBAC0032B63B /* ZXCircleProgressViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454335E21F7FBAC0032B63B /* ZXCircleProgressViewTests.m */; }; 17 | 7454336A21F7FBAC0032B63B /* ZXCircleProgressViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454336921F7FBAC0032B63B /* ZXCircleProgressViewUITests.m */; }; 18 | 7454337D21F7FED80032B63B /* UILabel+ZXGetLabelSize.m in Sources */ = {isa = PBXBuildFile; fileRef = 7454337C21F7FED80032B63B /* UILabel+ZXGetLabelSize.m */; }; 19 | 74D1F25721F84A45006E7169 /* ZXCircleProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 74D1F25621F84A45006E7169 /* ZXCircleProgressView.m */; }; 20 | 74D1F25A21F852F0006E7169 /* NSObject+ZXKVO.m in Sources */ = {isa = PBXBuildFile; fileRef = 74D1F25921F852EF006E7169 /* NSObject+ZXKVO.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 7454335B21F7FBAC0032B63B /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 7454333A21F7FBA90032B63B /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 7454334121F7FBAA0032B63B; 29 | remoteInfo = ZXCircleProgressView; 30 | }; 31 | 7454336621F7FBAC0032B63B /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 7454333A21F7FBA90032B63B /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 7454334121F7FBAA0032B63B; 36 | remoteInfo = ZXCircleProgressView; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 7454334221F7FBAA0032B63B /* ZXCircleProgressView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZXCircleProgressView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 7454334521F7FBAA0032B63B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | 7454334621F7FBAA0032B63B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | 7454334821F7FBAA0032B63B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 45 | 7454334921F7FBAA0032B63B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 46 | 7454334C21F7FBAA0032B63B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | 7454334E21F7FBAA0032B63B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 7454335121F7FBAA0032B63B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | 7454335321F7FBAA0032B63B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 7454335421F7FBAA0032B63B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 7454335A21F7FBAC0032B63B /* ZXCircleProgressViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZXCircleProgressViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 7454335E21F7FBAC0032B63B /* ZXCircleProgressViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXCircleProgressViewTests.m; sourceTree = ""; }; 53 | 7454336021F7FBAC0032B63B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 7454336521F7FBAC0032B63B /* ZXCircleProgressViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZXCircleProgressViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 7454336921F7FBAC0032B63B /* ZXCircleProgressViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXCircleProgressViewUITests.m; sourceTree = ""; }; 56 | 7454336B21F7FBAC0032B63B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 7454337B21F7FED80032B63B /* UILabel+ZXGetLabelSize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UILabel+ZXGetLabelSize.h"; sourceTree = ""; }; 58 | 7454337C21F7FED80032B63B /* UILabel+ZXGetLabelSize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UILabel+ZXGetLabelSize.m"; sourceTree = ""; }; 59 | 74D1F25521F84A44006E7169 /* ZXCircleProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXCircleProgressView.h; sourceTree = ""; }; 60 | 74D1F25621F84A45006E7169 /* ZXCircleProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXCircleProgressView.m; sourceTree = ""; }; 61 | 74D1F25821F852EF006E7169 /* NSObject+ZXKVO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+ZXKVO.h"; sourceTree = ""; }; 62 | 74D1F25921F852EF006E7169 /* NSObject+ZXKVO.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+ZXKVO.m"; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 7454333F21F7FBAA0032B63B /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 7454335721F7FBAC0032B63B /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | 7454336221F7FBAC0032B63B /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 7454333921F7FBA90032B63B = { 91 | isa = PBXGroup; 92 | children = ( 93 | 7454334421F7FBAA0032B63B /* ZXCircleProgressView */, 94 | 7454335D21F7FBAC0032B63B /* ZXCircleProgressViewTests */, 95 | 7454336821F7FBAC0032B63B /* ZXCircleProgressViewUITests */, 96 | 7454334321F7FBAA0032B63B /* Products */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 7454334321F7FBAA0032B63B /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 7454334221F7FBAA0032B63B /* ZXCircleProgressView.app */, 104 | 7454335A21F7FBAC0032B63B /* ZXCircleProgressViewTests.xctest */, 105 | 7454336521F7FBAC0032B63B /* ZXCircleProgressViewUITests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 7454334421F7FBAA0032B63B /* ZXCircleProgressView */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 7454337721F7FBEA0032B63B /* ZXCircleProgressViewCore */, 114 | 7454334521F7FBAA0032B63B /* AppDelegate.h */, 115 | 7454334621F7FBAA0032B63B /* AppDelegate.m */, 116 | 7454334821F7FBAA0032B63B /* ViewController.h */, 117 | 7454334921F7FBAA0032B63B /* ViewController.m */, 118 | 7454334B21F7FBAA0032B63B /* Main.storyboard */, 119 | 7454334E21F7FBAA0032B63B /* Assets.xcassets */, 120 | 7454335021F7FBAA0032B63B /* LaunchScreen.storyboard */, 121 | 7454335321F7FBAA0032B63B /* Info.plist */, 122 | 7454335421F7FBAA0032B63B /* main.m */, 123 | ); 124 | path = ZXCircleProgressView; 125 | sourceTree = ""; 126 | }; 127 | 7454335D21F7FBAC0032B63B /* ZXCircleProgressViewTests */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 7454335E21F7FBAC0032B63B /* ZXCircleProgressViewTests.m */, 131 | 7454336021F7FBAC0032B63B /* Info.plist */, 132 | ); 133 | path = ZXCircleProgressViewTests; 134 | sourceTree = ""; 135 | }; 136 | 7454336821F7FBAC0032B63B /* ZXCircleProgressViewUITests */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 7454336921F7FBAC0032B63B /* ZXCircleProgressViewUITests.m */, 140 | 7454336B21F7FBAC0032B63B /* Info.plist */, 141 | ); 142 | path = ZXCircleProgressViewUITests; 143 | sourceTree = ""; 144 | }; 145 | 7454337721F7FBEA0032B63B /* ZXCircleProgressViewCore */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 74D1F25521F84A44006E7169 /* ZXCircleProgressView.h */, 149 | 74D1F25621F84A45006E7169 /* ZXCircleProgressView.m */, 150 | 7454337B21F7FED80032B63B /* UILabel+ZXGetLabelSize.h */, 151 | 7454337C21F7FED80032B63B /* UILabel+ZXGetLabelSize.m */, 152 | 74D1F25821F852EF006E7169 /* NSObject+ZXKVO.h */, 153 | 74D1F25921F852EF006E7169 /* NSObject+ZXKVO.m */, 154 | ); 155 | path = ZXCircleProgressViewCore; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | 7454334121F7FBAA0032B63B /* ZXCircleProgressView */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = 7454336E21F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressView" */; 164 | buildPhases = ( 165 | 7454333E21F7FBAA0032B63B /* Sources */, 166 | 7454333F21F7FBAA0032B63B /* Frameworks */, 167 | 7454334021F7FBAA0032B63B /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = ZXCircleProgressView; 174 | productName = ZXCircleProgressView; 175 | productReference = 7454334221F7FBAA0032B63B /* ZXCircleProgressView.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | 7454335921F7FBAC0032B63B /* ZXCircleProgressViewTests */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = 7454337121F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressViewTests" */; 181 | buildPhases = ( 182 | 7454335621F7FBAC0032B63B /* Sources */, 183 | 7454335721F7FBAC0032B63B /* Frameworks */, 184 | 7454335821F7FBAC0032B63B /* Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | 7454335C21F7FBAC0032B63B /* PBXTargetDependency */, 190 | ); 191 | name = ZXCircleProgressViewTests; 192 | productName = ZXCircleProgressViewTests; 193 | productReference = 7454335A21F7FBAC0032B63B /* ZXCircleProgressViewTests.xctest */; 194 | productType = "com.apple.product-type.bundle.unit-test"; 195 | }; 196 | 7454336421F7FBAC0032B63B /* ZXCircleProgressViewUITests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 7454337421F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressViewUITests" */; 199 | buildPhases = ( 200 | 7454336121F7FBAC0032B63B /* Sources */, 201 | 7454336221F7FBAC0032B63B /* Frameworks */, 202 | 7454336321F7FBAC0032B63B /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | 7454336721F7FBAC0032B63B /* PBXTargetDependency */, 208 | ); 209 | name = ZXCircleProgressViewUITests; 210 | productName = ZXCircleProgressViewUITests; 211 | productReference = 7454336521F7FBAC0032B63B /* ZXCircleProgressViewUITests.xctest */; 212 | productType = "com.apple.product-type.bundle.ui-testing"; 213 | }; 214 | /* End PBXNativeTarget section */ 215 | 216 | /* Begin PBXProject section */ 217 | 7454333A21F7FBA90032B63B /* Project object */ = { 218 | isa = PBXProject; 219 | attributes = { 220 | LastUpgradeCheck = 0920; 221 | ORGANIZATIONNAME = "李兆祥"; 222 | TargetAttributes = { 223 | 7454334121F7FBAA0032B63B = { 224 | CreatedOnToolsVersion = 9.2; 225 | ProvisioningStyle = Automatic; 226 | }; 227 | 7454335921F7FBAC0032B63B = { 228 | CreatedOnToolsVersion = 9.2; 229 | ProvisioningStyle = Automatic; 230 | TestTargetID = 7454334121F7FBAA0032B63B; 231 | }; 232 | 7454336421F7FBAC0032B63B = { 233 | CreatedOnToolsVersion = 9.2; 234 | ProvisioningStyle = Automatic; 235 | TestTargetID = 7454334121F7FBAA0032B63B; 236 | }; 237 | }; 238 | }; 239 | buildConfigurationList = 7454333D21F7FBA90032B63B /* Build configuration list for PBXProject "ZXCircleProgressView" */; 240 | compatibilityVersion = "Xcode 8.0"; 241 | developmentRegion = en; 242 | hasScannedForEncodings = 0; 243 | knownRegions = ( 244 | en, 245 | Base, 246 | ); 247 | mainGroup = 7454333921F7FBA90032B63B; 248 | productRefGroup = 7454334321F7FBAA0032B63B /* Products */; 249 | projectDirPath = ""; 250 | projectRoot = ""; 251 | targets = ( 252 | 7454334121F7FBAA0032B63B /* ZXCircleProgressView */, 253 | 7454335921F7FBAC0032B63B /* ZXCircleProgressViewTests */, 254 | 7454336421F7FBAC0032B63B /* ZXCircleProgressViewUITests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 7454334021F7FBAA0032B63B /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 7454335221F7FBAA0032B63B /* LaunchScreen.storyboard in Resources */, 265 | 7454334F21F7FBAA0032B63B /* Assets.xcassets in Resources */, 266 | 7454334D21F7FBAA0032B63B /* Main.storyboard in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 7454335821F7FBAC0032B63B /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 7454336321F7FBAC0032B63B /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXResourcesBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | 7454333E21F7FBAA0032B63B /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 7454334A21F7FBAA0032B63B /* ViewController.m in Sources */, 292 | 74D1F25721F84A45006E7169 /* ZXCircleProgressView.m in Sources */, 293 | 74D1F25A21F852F0006E7169 /* NSObject+ZXKVO.m in Sources */, 294 | 7454335521F7FBAA0032B63B /* main.m in Sources */, 295 | 7454337D21F7FED80032B63B /* UILabel+ZXGetLabelSize.m in Sources */, 296 | 7454334721F7FBAA0032B63B /* AppDelegate.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | 7454335621F7FBAC0032B63B /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | 7454335F21F7FBAC0032B63B /* ZXCircleProgressViewTests.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | 7454336121F7FBAC0032B63B /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 7454336A21F7FBAC0032B63B /* ZXCircleProgressViewUITests.m in Sources */, 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | }; 316 | /* End PBXSourcesBuildPhase section */ 317 | 318 | /* Begin PBXTargetDependency section */ 319 | 7454335C21F7FBAC0032B63B /* PBXTargetDependency */ = { 320 | isa = PBXTargetDependency; 321 | target = 7454334121F7FBAA0032B63B /* ZXCircleProgressView */; 322 | targetProxy = 7454335B21F7FBAC0032B63B /* PBXContainerItemProxy */; 323 | }; 324 | 7454336721F7FBAC0032B63B /* PBXTargetDependency */ = { 325 | isa = PBXTargetDependency; 326 | target = 7454334121F7FBAA0032B63B /* ZXCircleProgressView */; 327 | targetProxy = 7454336621F7FBAC0032B63B /* PBXContainerItemProxy */; 328 | }; 329 | /* End PBXTargetDependency section */ 330 | 331 | /* Begin PBXVariantGroup section */ 332 | 7454334B21F7FBAA0032B63B /* Main.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 7454334C21F7FBAA0032B63B /* Base */, 336 | ); 337 | name = Main.storyboard; 338 | sourceTree = ""; 339 | }; 340 | 7454335021F7FBAA0032B63B /* LaunchScreen.storyboard */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 7454335121F7FBAA0032B63B /* Base */, 344 | ); 345 | name = LaunchScreen.storyboard; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 7454336C21F7FBAC0032B63B /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_ANALYZER_NONNULL = YES; 356 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 358 | CLANG_CXX_LIBRARY = "libc++"; 359 | CLANG_ENABLE_MODULES = YES; 360 | CLANG_ENABLE_OBJC_ARC = YES; 361 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 362 | CLANG_WARN_BOOL_CONVERSION = YES; 363 | CLANG_WARN_COMMA = YES; 364 | CLANG_WARN_CONSTANT_CONVERSION = YES; 365 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 366 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INFINITE_RECURSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 372 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 373 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 374 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 375 | CLANG_WARN_STRICT_PROTOTYPES = YES; 376 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 377 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 378 | CLANG_WARN_UNREACHABLE_CODE = YES; 379 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 380 | CODE_SIGN_IDENTITY = "iPhone Developer"; 381 | COPY_PHASE_STRIP = NO; 382 | DEBUG_INFORMATION_FORMAT = dwarf; 383 | ENABLE_STRICT_OBJC_MSGSEND = YES; 384 | ENABLE_TESTABILITY = YES; 385 | GCC_C_LANGUAGE_STANDARD = gnu11; 386 | GCC_DYNAMIC_NO_PIC = NO; 387 | GCC_NO_COMMON_BLOCKS = YES; 388 | GCC_OPTIMIZATION_LEVEL = 0; 389 | GCC_PREPROCESSOR_DEFINITIONS = ( 390 | "DEBUG=1", 391 | "$(inherited)", 392 | ); 393 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 394 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 395 | GCC_WARN_UNDECLARED_SELECTOR = YES; 396 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 397 | GCC_WARN_UNUSED_FUNCTION = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 400 | MTL_ENABLE_DEBUG_INFO = YES; 401 | ONLY_ACTIVE_ARCH = YES; 402 | SDKROOT = iphoneos; 403 | }; 404 | name = Debug; 405 | }; 406 | 7454336D21F7FBAC0032B63B /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ALWAYS_SEARCH_USER_PATHS = NO; 410 | CLANG_ANALYZER_NONNULL = YES; 411 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 412 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 413 | CLANG_CXX_LIBRARY = "libc++"; 414 | CLANG_ENABLE_MODULES = YES; 415 | CLANG_ENABLE_OBJC_ARC = YES; 416 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 417 | CLANG_WARN_BOOL_CONVERSION = YES; 418 | CLANG_WARN_COMMA = YES; 419 | CLANG_WARN_CONSTANT_CONVERSION = YES; 420 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 421 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 422 | CLANG_WARN_EMPTY_BODY = YES; 423 | CLANG_WARN_ENUM_CONVERSION = YES; 424 | CLANG_WARN_INFINITE_RECURSION = YES; 425 | CLANG_WARN_INT_CONVERSION = YES; 426 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 427 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 428 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 429 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 430 | CLANG_WARN_STRICT_PROTOTYPES = YES; 431 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 432 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 433 | CLANG_WARN_UNREACHABLE_CODE = YES; 434 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 435 | CODE_SIGN_IDENTITY = "iPhone Developer"; 436 | COPY_PHASE_STRIP = NO; 437 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 438 | ENABLE_NS_ASSERTIONS = NO; 439 | ENABLE_STRICT_OBJC_MSGSEND = YES; 440 | GCC_C_LANGUAGE_STANDARD = gnu11; 441 | GCC_NO_COMMON_BLOCKS = YES; 442 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 443 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 444 | GCC_WARN_UNDECLARED_SELECTOR = YES; 445 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 446 | GCC_WARN_UNUSED_FUNCTION = YES; 447 | GCC_WARN_UNUSED_VARIABLE = YES; 448 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 449 | MTL_ENABLE_DEBUG_INFO = NO; 450 | SDKROOT = iphoneos; 451 | VALIDATE_PRODUCT = YES; 452 | }; 453 | name = Release; 454 | }; 455 | 7454336F21F7FBAC0032B63B /* Debug */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 459 | CODE_SIGN_STYLE = Automatic; 460 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 461 | INFOPLIST_FILE = ZXCircleProgressView/Info.plist; 462 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressView; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | TARGETED_DEVICE_FAMILY = "1,2"; 467 | }; 468 | name = Debug; 469 | }; 470 | 7454337021F7FBAC0032B63B /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 474 | CODE_SIGN_STYLE = Automatic; 475 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 476 | INFOPLIST_FILE = ZXCircleProgressView/Info.plist; 477 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressView; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TARGETED_DEVICE_FAMILY = "1,2"; 482 | }; 483 | name = Release; 484 | }; 485 | 7454337221F7FBAC0032B63B /* Debug */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | BUNDLE_LOADER = "$(TEST_HOST)"; 489 | CODE_SIGN_STYLE = Automatic; 490 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 491 | INFOPLIST_FILE = ZXCircleProgressViewTests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressViewTests; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZXCircleProgressView.app/ZXCircleProgressView"; 497 | }; 498 | name = Debug; 499 | }; 500 | 7454337321F7FBAC0032B63B /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | BUNDLE_LOADER = "$(TEST_HOST)"; 504 | CODE_SIGN_STYLE = Automatic; 505 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 506 | INFOPLIST_FILE = ZXCircleProgressViewTests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressViewTests; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TARGETED_DEVICE_FAMILY = "1,2"; 511 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZXCircleProgressView.app/ZXCircleProgressView"; 512 | }; 513 | name = Release; 514 | }; 515 | 7454337521F7FBAC0032B63B /* Debug */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | CODE_SIGN_STYLE = Automatic; 519 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 520 | INFOPLIST_FILE = ZXCircleProgressViewUITests/Info.plist; 521 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 522 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressViewUITests; 523 | PRODUCT_NAME = "$(TARGET_NAME)"; 524 | TARGETED_DEVICE_FAMILY = "1,2"; 525 | TEST_TARGET_NAME = ZXCircleProgressView; 526 | }; 527 | name = Debug; 528 | }; 529 | 7454337621F7FBAC0032B63B /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | CODE_SIGN_STYLE = Automatic; 533 | DEVELOPMENT_TEAM = 4Y2YPWFYNQ; 534 | INFOPLIST_FILE = ZXCircleProgressViewUITests/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = zxlee.cn.ZXCircleProgressViewUITests; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | TARGETED_DEVICE_FAMILY = "1,2"; 539 | TEST_TARGET_NAME = ZXCircleProgressView; 540 | }; 541 | name = Release; 542 | }; 543 | /* End XCBuildConfiguration section */ 544 | 545 | /* Begin XCConfigurationList section */ 546 | 7454333D21F7FBA90032B63B /* Build configuration list for PBXProject "ZXCircleProgressView" */ = { 547 | isa = XCConfigurationList; 548 | buildConfigurations = ( 549 | 7454336C21F7FBAC0032B63B /* Debug */, 550 | 7454336D21F7FBAC0032B63B /* Release */, 551 | ); 552 | defaultConfigurationIsVisible = 0; 553 | defaultConfigurationName = Release; 554 | }; 555 | 7454336E21F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressView" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | 7454336F21F7FBAC0032B63B /* Debug */, 559 | 7454337021F7FBAC0032B63B /* Release */, 560 | ); 561 | defaultConfigurationIsVisible = 0; 562 | defaultConfigurationName = Release; 563 | }; 564 | 7454337121F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressViewTests" */ = { 565 | isa = XCConfigurationList; 566 | buildConfigurations = ( 567 | 7454337221F7FBAC0032B63B /* Debug */, 568 | 7454337321F7FBAC0032B63B /* Release */, 569 | ); 570 | defaultConfigurationIsVisible = 0; 571 | defaultConfigurationName = Release; 572 | }; 573 | 7454337421F7FBAC0032B63B /* Build configuration list for PBXNativeTarget "ZXCircleProgressViewUITests" */ = { 574 | isa = XCConfigurationList; 575 | buildConfigurations = ( 576 | 7454337521F7FBAC0032B63B /* Debug */, 577 | 7454337621F7FBAC0032B63B /* Release */, 578 | ); 579 | defaultConfigurationIsVisible = 0; 580 | defaultConfigurationName = Release; 581 | }; 582 | /* End XCConfigurationList section */ 583 | }; 584 | rootObject = 7454333A21F7FBA90032B63B /* Project object */; 585 | } 586 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/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 | } -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ZXCircleProgressView.h" 11 | @interface ViewController () 12 | 13 | @property (weak, nonatomic) ZXCircleProgressView *progressView; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | NSArray *titlesArr = @[@"test1",@"test2",@"test3",@"test4",@"test5"]; 21 | ZXCircleProgressView *V = [[ZXCircleProgressView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 60) titlesArr:titlesArr]; 22 | V.backgroundColor = [UIColor yellowColor]; 23 | self.progressView = V; 24 | [self.view addSubview:V]; 25 | } 26 | 27 | - (IBAction)segIndexChangeAction:(id)sender { 28 | UISegmentedControl *segV = (UISegmentedControl *)sender; 29 | self.progressView.index = segV.selectedSegmentIndex; 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/NSObject+ZXKVO.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+ZXKVO.h 3 | // ZXKVO 4 | // 5 | // Created by 李兆祥 on 2018/8/22. 6 | // Copyright © 2018年 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void(^obsResultHandler) (id newData, id oldData,id owner); 11 | @interface NSObject (ZXKVO) 12 | -(void)obsKey:(NSString *)key handler:(obsResultHandler)handler; 13 | @end 14 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/NSObject+ZXKVO.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+ZXKVO.m 3 | // ZXKVO 4 | // 5 | // Created by 李兆祥 on 2018/8/22. 6 | // Copyright © 2018年 李兆祥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+ZXKVO.h" 10 | 11 | @implementation NSObject (ZXKVO) 12 | -(void)obsKey:(NSString *)key handler:(obsResultHandler)handler{ 13 | [self addObserver:self forKeyPath:key options:NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew context:CFBridgingRetain([handler copy])]; 14 | } 15 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ 16 | if(object == self){ 17 | obsResultHandler handler = (__bridge obsResultHandler)context; 18 | handler(change[@"new"],change[@"old"],self); 19 | } 20 | } 21 | @end 22 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/UILabel+ZXGetLabelSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+ZXGetLabelSize.h 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (ZXGetLabelSize) 12 | - (CGFloat)getRectWidth; 13 | - (CGFloat)getRectHeight; 14 | @end 15 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/UILabel+ZXGetLabelSize.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+ZXGetLabelSize.m 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import "UILabel+ZXGetLabelSize.h" 10 | 11 | @implementation UILabel (ZXGetLabelSize) 12 | - (CGFloat)getRectWidth{ 13 | CGRect rect = [self.text boundingRectWithSize:CGSizeMake(MAXFLOAT, self.frame.size.height) 14 | options:NSStringDrawingUsesLineFragmentOrigin 15 | attributes:@{NSFontAttributeName:self.font} 16 | context:nil]; 17 | return rect.size.width; 18 | } 19 | - (CGFloat)getRectHeight{ 20 | CGRect rect = [self.text boundingRectWithSize:CGSizeMake(self.frame.size.width,MAXFLOAT ) 21 | options:NSStringDrawingUsesLineFragmentOrigin 22 | attributes:@{NSFontAttributeName:self.font} 23 | context:nil]; 24 | return rect.size.height; 25 | } 26 | @end 27 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/ZXCircleProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZXCircleProgressView2.h 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ZXCircleProgressView : UIView 14 | -(instancetype)initWithFrame:(CGRect)frame titlesArr:(NSArray *)titlesArr; 15 | -(instancetype)initWithFrame:(CGRect)frame titlesArr:(NSArray *)titlesArr grayColor:(UIColor *)grayColor lightColor:(UIColor *)lightColor; 16 | 17 | ///当前选中的index 18 | @property(nonatomic,assign)NSUInteger index; 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/ZXCircleProgressViewCore/ZXCircleProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZXCircleProgressView2.m 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | #define SubVerticalMargin 6.0 //CircleLabel和TitleLabel之间的垂直距离 9 | #define CircleLabelSize 16.0 //CircleLabel的大小 10 | #define TitleLabelMargin 30.0 //TitleLabel与边缘的间距,越大则间距越大 11 | #define TagOffset 888 //ContentV中tag的偏移,避免冲突 12 | 13 | #define DefaultGrayColor [UIColor lightGrayColor] //灰色颜色值 14 | #define DefaultLightColor [UIColor redColor] //点亮颜色值 15 | 16 | #define Setp 4 //进度条每次增加(或减少)像素 越高则变化越快 17 | #import "ZXCircleProgressView.h" 18 | #import "UILabel+ZXGetLabelSize.h" 19 | #import "NSObject+ZXKVO.h" 20 | @interface ZXCircleProgressView() 21 | @property(nonatomic,strong)NSMutableArray *contentVArr; 22 | @property(nonatomic,assign)NSUInteger lastIndex; 23 | @property(nonatomic,weak)UIView *lightProgressView; 24 | @property(nonatomic,assign)CGFloat perProgW; 25 | @property(nonatomic,assign)BOOL back; 26 | ///灰色时颜色(选填) 27 | @property(nonatomic,strong)UIColor *grayColor; 28 | ///点亮时颜色(选填) 29 | @property(nonatomic,strong)UIColor *lightColor; 30 | 31 | @end 32 | @implementation ZXCircleProgressView 33 | #pragma mark 初始化方法 34 | -(instancetype)initWithFrame:(CGRect)frame titlesArr:(NSArray *)titlesArr{ 35 | 36 | return [self initWithFrame:frame titlesArr:titlesArr grayColor:nil lightColor:nil]; 37 | } 38 | -(instancetype)initWithFrame:(CGRect)frame titlesArr:(NSArray *)titlesArr grayColor:(UIColor *)grayColor lightColor:(UIColor *)lightColor{ 39 | if(self = [super initWithFrame:frame]){ 40 | self.grayColor = grayColor ? grayColor : DefaultGrayColor; 41 | self.lightColor = lightColor ? lightColor : DefaultLightColor; 42 | [self creatViewWithTitlesArr:titlesArr]; 43 | self.index = 0; 44 | } 45 | return self; 46 | } 47 | #pragma mark 根据传进来的titles数组创建视图 48 | -(void)creatViewWithTitlesArr:(NSArray *)titlesArr{ 49 | NSArray *titleLabelsArr = [self getTitleLabelsWithCount:titlesArr.count]; 50 | CGFloat maxTitleLabelW = [self getTextMaxWidthWithTitlesArr:titlesArr Labels:titleLabelsArr]; 51 | CGFloat margin = 0; 52 | CGFloat containVW = maxTitleLabelW + TitleLabelMargin / 2; 53 | CGFloat containVX = (self.frame.size.width - containVW * titlesArr.count - margin * (titlesArr.count - 1)) / 2; 54 | CGFloat progressX = 0; 55 | CGFloat progressY = 0; 56 | CGFloat progressW = 0; 57 | for (NSUInteger i = 0; i < titlesArr.count; i++) { 58 | UIView *containV = [[UIView alloc]init]; 59 | containV.frame = CGRectMake(containVX + (containVW + margin) * i, 0, containVW, self.frame.size.height); 60 | UILabel *circleLabel = [self getCircleLabelWithIndex:i supV:containV]; 61 | containV.tag = TagOffset + i; 62 | [containV addSubview:circleLabel]; 63 | 64 | UILabel *titleLabel = titleLabelsArr[i]; 65 | titleLabel.frame = CGRectMake(0, CGRectGetMaxY(circleLabel.frame) + SubVerticalMargin / 2, containV.frame.size.width, titleLabel.frame.size.height); 66 | titleLabel.textColor = circleLabel.backgroundColor; 67 | [containV addSubview:titleLabel]; 68 | 69 | 70 | [self.contentVArr addObject:containV]; 71 | [self addSubview:containV]; 72 | CGRect convertCircleFrame = [self convertRect:circleLabel.frame fromView:containV]; 73 | if(i == 0){ 74 | progressX = convertCircleFrame.origin.x + circleLabel.frame.size.height / 2; 75 | progressY = convertCircleFrame.origin.y + circleLabel.frame.size.height / 2; 76 | } 77 | if(i == 0 || i == titlesArr.count - 1){ 78 | progressW += (containV.frame.size.width - circleLabel.frame.size.width) / 2 + circleLabel.frame.size.width / 2; 79 | self.perProgW = (containV.frame.size.width - circleLabel.frame.size.width) / 2 + circleLabel.frame.size.width / 2; 80 | 81 | }else{ 82 | progressW += 2 * ((containV.frame.size.width - circleLabel.frame.size.width) / 2 + circleLabel.frame.size.width / 2); 83 | } 84 | } 85 | UIView *grayProgressV = [[UIView alloc]init]; 86 | grayProgressV.frame = CGRectMake(progressX, progressY, progressW, 1); 87 | grayProgressV.backgroundColor = self.grayColor; 88 | 89 | UIView *lightProgressV = [[UIView alloc]init]; 90 | lightProgressV.frame = CGRectMake(progressX, progressY, 0, 1); 91 | lightProgressV.backgroundColor = self.lightColor; 92 | /* 93 | [lightProgressV obsKey:@"frame" handler:^(id newData, id oldData, id owner) { 94 | CGRect rect = ((UIView *)owner).frame; 95 | int proW = roundf(rect.size.width * 100); 96 | int perW = roundf(self.perProgW * 2 * 100); 97 | if(ABS(proW % perW) < 100){ 98 | NSUInteger currenIndex = proW / perW; 99 | NSLog(@"currenIndex--%d",currenIndex); 100 | } 101 | 102 | }]; 103 | */ 104 | 105 | [self addSubview:lightProgressV]; 106 | [self insertSubview:lightProgressV belowSubview:self.subviews.firstObject]; 107 | [self insertSubview:grayProgressV belowSubview:lightProgressV]; 108 | self.lightProgressView =lightProgressV; 109 | } 110 | 111 | #pragma mark 获取titles数组中长度最长的字符串长度,并以此作为contentV的宽 112 | -(CGFloat)getTextMaxWidthWithTitlesArr:(NSArray *)titlesArr Labels:(NSArray *)labels{ 113 | if(titlesArr.count != labels.count)return 0; 114 | CGFloat conLabelMaxW = 0; 115 | for (NSUInteger i = 0; i < titlesArr.count; i++) { 116 | UILabel *conLabel = labels[i]; 117 | conLabel.text = titlesArr[i]; 118 | CGFloat conLabelW = [conLabel getRectWidth]; 119 | conLabelMaxW = conLabelMaxW < conLabelW ? conLabelW : conLabelMaxW; 120 | } 121 | return conLabelMaxW; 122 | } 123 | 124 | #pragma mark 获取TitleLabel 125 | -(NSArray *)getTitleLabelsWithCount:(NSUInteger)count{ 126 | NSMutableArray *labelsArr = [NSMutableArray array]; 127 | for (NSUInteger i = 0; i < count; i++) { 128 | UILabel *label = [[UILabel alloc]init]; 129 | label.font = [UIFont systemFontOfSize:12]; 130 | label.frame = CGRectMake(0, 0, 0, 15); 131 | label.textAlignment = NSTextAlignmentCenter; 132 | label.textColor = [UIColor redColor]; 133 | [labelsArr addObject:label]; 134 | } 135 | return labelsArr; 136 | } 137 | 138 | #pragma mark 获取CircleLabel 139 | -(UILabel *)getCircleLabelWithIndex:(NSUInteger )index supV:(UIView *)supV{ 140 | UILabel *circleLabel = [[UILabel alloc]init]; 141 | circleLabel.frame = CGRectMake((supV.frame.size.width - CircleLabelSize) / 2, (supV.frame.size.height - CircleLabelSize) / 2 - SubVerticalMargin / 2 - 2, CircleLabelSize, CircleLabelSize); 142 | circleLabel.backgroundColor = self.grayColor; 143 | circleLabel.font = [UIFont systemFontOfSize:10]; 144 | circleLabel.textAlignment = NSTextAlignmentCenter; 145 | circleLabel.clipsToBounds = YES; 146 | circleLabel.layer.cornerRadius = circleLabel.frame.size.width / 2.0; 147 | circleLabel.textColor = [UIColor whiteColor]; 148 | circleLabel.text = [NSString stringWithFormat:@"%lu",index + 1]; 149 | circleLabel.adjustsFontSizeToFitWidth = YES; 150 | return circleLabel; 151 | } 152 | 153 | 154 | #pragma mark 重写index的set方法 155 | -(void)setIndex:(NSUInteger)index{ 156 | _index = index; 157 | self.back = self.lastIndex > self.index; 158 | self.lastIndex = self.index; 159 | CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(indexAnimate:)]; 160 | [displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; 161 | } 162 | 163 | #pragma mark 动画效果函数 164 | -(void)indexAnimate:(CADisplayLink *)cl{ 165 | CGFloat progressW = self.index * self.perProgW * 2; 166 | int step = self.back ? -Setp : Setp; 167 | CGFloat newProW = self.lightProgressView.frame.size.width + step; 168 | if(newProW > 0 && newProW < (self.contentVArr.count) * self.perProgW * 2){ 169 | self.lightProgressView.frame = CGRectMake(self.lightProgressView.frame.origin.x, self.lightProgressView.frame.origin.y,self.lightProgressView.frame.size.width + step, 1); 170 | } 171 | int currenIndex = [self getCurrenIndexWithFrame:self.lightProgressView.frame]; 172 | if(currenIndex >= 0){ 173 | 174 | if(step >= 0){ 175 | UIView *currenContentV = self.contentVArr[currenIndex]; 176 | [self lightContentView:currenContentV]; 177 | }else{ 178 | if(currenIndex + 1 < self.contentVArr.count){ 179 | UIView *currenContentV = self.contentVArr[currenIndex + 1]; 180 | [self grayContentView:currenContentV]; 181 | } 182 | } 183 | } 184 | 185 | if(step >= 0 && self.lightProgressView.frame.size.width >= progressW){ 186 | [cl invalidate]; 187 | cl = nil; 188 | } 189 | if(step < 0 && (self.lightProgressView.frame.size.width <= progressW || (self.index == 0 && self.lightProgressView.frame.size.width <= CircleLabelSize / 2.0))){ 190 | [cl invalidate]; 191 | cl = nil; 192 | } 193 | 194 | } 195 | #pragma mark 根据frame获取当前动画进行到的index 196 | -(int)getCurrenIndexWithFrame:(CGRect)frame{ 197 | CGRect rect = frame; 198 | int proW = roundf(rect.size.width * 100); 199 | int perW = roundf(self.perProgW * 2 * 100); 200 | if(ABS(proW % perW) < 1000){ 201 | NSUInteger currenIndex = proW / perW; 202 | return (int)currenIndex; 203 | } 204 | return -1; 205 | } 206 | #pragma mark 将contentV点亮 207 | -(void)lightContentView:(UIView * )contentV{ 208 | UILabel *circleLabel = contentV.subviews[0]; 209 | UILabel *titleLabel = contentV.subviews[1]; 210 | circleLabel.backgroundColor = self.lightColor; 211 | titleLabel.textColor = self.lightColor; 212 | } 213 | #pragma mark 将contentV变灰 214 | -(void)grayContentView:(UIView * )contentV{ 215 | UILabel *circleLabel = contentV.subviews[0]; 216 | UILabel *titleLabel = contentV.subviews[1]; 217 | circleLabel.backgroundColor = self.grayColor; 218 | titleLabel.textColor = self.grayColor; 219 | } 220 | 221 | #pragma mark 懒加载 222 | -(NSMutableArray *)contentVArr{ 223 | if(!_contentVArr){ 224 | _contentVArr = [NSMutableArray array]; 225 | } 226 | return _contentVArr; 227 | } 228 | @end 229 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZXCircleProgressView 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressViewTests/ZXCircleProgressViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZXCircleProgressViewTests.m 3 | // ZXCircleProgressViewTests 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZXCircleProgressViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZXCircleProgressViewTests 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /ZXCircleProgressView/ZXCircleProgressViewUITests/ZXCircleProgressViewUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZXCircleProgressViewUITests.m 3 | // ZXCircleProgressViewUITests 4 | // 5 | // Created by 李兆祥 on 2019/1/23. 6 | // Copyright © 2019 李兆祥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZXCircleProgressViewUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZXCircleProgressViewUITests 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 | --------------------------------------------------------------------------------