├── Dashboard.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── wanglingbo1.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── wanglingbo1.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── Dashboard ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Dashboard.h ├── Dashboard.m ├── Info.plist ├── UIColor+Extension.h ├── UIColor+Extension.m ├── UIView+Extension.h ├── UIView+Extension.m ├── ViewController.h ├── ViewController.m └── main.m ├── DashboardTests ├── DashboardTests.m └── Info.plist ├── DashboardUITests ├── DashboardUITests.m └── Info.plist ├── README.md └── images ├── WechatIMG.png └── picture /Dashboard.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5EC81B9522A8C146004E4A88 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81B9422A8C146004E4A88 /* AppDelegate.m */; }; 11 | 5EC81B9822A8C146004E4A88 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81B9722A8C146004E4A88 /* ViewController.m */; }; 12 | 5EC81B9B22A8C146004E4A88 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EC81B9922A8C146004E4A88 /* Main.storyboard */; }; 13 | 5EC81B9D22A8C146004E4A88 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5EC81B9C22A8C146004E4A88 /* Assets.xcassets */; }; 14 | 5EC81BA022A8C146004E4A88 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EC81B9E22A8C146004E4A88 /* LaunchScreen.storyboard */; }; 15 | 5EC81BA322A8C146004E4A88 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BA222A8C146004E4A88 /* main.m */; }; 16 | 5EC81BAD22A8C146004E4A88 /* DashboardTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BAC22A8C146004E4A88 /* DashboardTests.m */; }; 17 | 5EC81BB822A8C146004E4A88 /* DashboardUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BB722A8C146004E4A88 /* DashboardUITests.m */; }; 18 | 5EC81BC922A8C1B4004E4A88 /* UIColor+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BC522A8C1B4004E4A88 /* UIColor+Extension.m */; }; 19 | 5EC81BCA22A8C1B4004E4A88 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BC622A8C1B4004E4A88 /* UIView+Extension.m */; }; 20 | 5EC81BCD22A8C1D3004E4A88 /* Dashboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC81BCC22A8C1D3004E4A88 /* Dashboard.m */; }; 21 | 5EC81BCF22A8DE61004E4A88 /* circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 5EC81BCE22A8DE61004E4A88 /* circle.png */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 5EC81BA922A8C146004E4A88 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 5EC81B8822A8C146004E4A88 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 5EC81B8F22A8C146004E4A88; 30 | remoteInfo = Dashboard; 31 | }; 32 | 5EC81BB422A8C146004E4A88 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 5EC81B8822A8C146004E4A88 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 5EC81B8F22A8C146004E4A88; 37 | remoteInfo = Dashboard; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 5EC81B9022A8C146004E4A88 /* Dashboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Dashboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 5EC81B9322A8C146004E4A88 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 44 | 5EC81B9422A8C146004E4A88 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 45 | 5EC81B9622A8C146004E4A88 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 46 | 5EC81B9722A8C146004E4A88 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 47 | 5EC81B9A22A8C146004E4A88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | 5EC81B9C22A8C146004E4A88 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 49 | 5EC81B9F22A8C146004E4A88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 50 | 5EC81BA122A8C146004E4A88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 5EC81BA222A8C146004E4A88 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 5EC81BA822A8C146004E4A88 /* DashboardTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DashboardTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 5EC81BAC22A8C146004E4A88 /* DashboardTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DashboardTests.m; sourceTree = ""; }; 54 | 5EC81BAE22A8C146004E4A88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 5EC81BB322A8C146004E4A88 /* DashboardUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DashboardUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 5EC81BB722A8C146004E4A88 /* DashboardUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DashboardUITests.m; sourceTree = ""; }; 57 | 5EC81BB922A8C146004E4A88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 5EC81BC522A8C1B4004E4A88 /* UIColor+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extension.m"; sourceTree = ""; }; 59 | 5EC81BC622A8C1B4004E4A88 /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = ""; }; 60 | 5EC81BC722A8C1B4004E4A88 /* UIColor+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extension.h"; sourceTree = ""; }; 61 | 5EC81BC822A8C1B4004E4A88 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = ""; }; 62 | 5EC81BCB22A8C1D3004E4A88 /* Dashboard.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Dashboard.h; sourceTree = ""; }; 63 | 5EC81BCC22A8C1D3004E4A88 /* Dashboard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Dashboard.m; sourceTree = ""; }; 64 | 5EC81BCE22A8DE61004E4A88 /* circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = circle.png; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 5EC81B8D22A8C146004E4A88 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 5EC81BA522A8C146004E4A88 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | 5EC81BB022A8C146004E4A88 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | 5EC81B8722A8C146004E4A88 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 5EC81B9222A8C146004E4A88 /* Dashboard */, 96 | 5EC81BAB22A8C146004E4A88 /* DashboardTests */, 97 | 5EC81BB622A8C146004E4A88 /* DashboardUITests */, 98 | 5EC81B9122A8C146004E4A88 /* Products */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | 5EC81B9122A8C146004E4A88 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 5EC81B9022A8C146004E4A88 /* Dashboard.app */, 106 | 5EC81BA822A8C146004E4A88 /* DashboardTests.xctest */, 107 | 5EC81BB322A8C146004E4A88 /* DashboardUITests.xctest */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | 5EC81B9222A8C146004E4A88 /* Dashboard */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 5EC81B9322A8C146004E4A88 /* AppDelegate.h */, 116 | 5EC81B9422A8C146004E4A88 /* AppDelegate.m */, 117 | 5EC81B9622A8C146004E4A88 /* ViewController.h */, 118 | 5EC81B9722A8C146004E4A88 /* ViewController.m */, 119 | 5EC81BCE22A8DE61004E4A88 /* circle.png */, 120 | 5EC81BCB22A8C1D3004E4A88 /* Dashboard.h */, 121 | 5EC81BCC22A8C1D3004E4A88 /* Dashboard.m */, 122 | 5EC81BC822A8C1B4004E4A88 /* UIView+Extension.h */, 123 | 5EC81BC622A8C1B4004E4A88 /* UIView+Extension.m */, 124 | 5EC81BC722A8C1B4004E4A88 /* UIColor+Extension.h */, 125 | 5EC81BC522A8C1B4004E4A88 /* UIColor+Extension.m */, 126 | 5EC81B9922A8C146004E4A88 /* Main.storyboard */, 127 | 5EC81B9C22A8C146004E4A88 /* Assets.xcassets */, 128 | 5EC81B9E22A8C146004E4A88 /* LaunchScreen.storyboard */, 129 | 5EC81BA122A8C146004E4A88 /* Info.plist */, 130 | 5EC81BA222A8C146004E4A88 /* main.m */, 131 | ); 132 | path = Dashboard; 133 | sourceTree = ""; 134 | }; 135 | 5EC81BAB22A8C146004E4A88 /* DashboardTests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 5EC81BAC22A8C146004E4A88 /* DashboardTests.m */, 139 | 5EC81BAE22A8C146004E4A88 /* Info.plist */, 140 | ); 141 | path = DashboardTests; 142 | sourceTree = ""; 143 | }; 144 | 5EC81BB622A8C146004E4A88 /* DashboardUITests */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 5EC81BB722A8C146004E4A88 /* DashboardUITests.m */, 148 | 5EC81BB922A8C146004E4A88 /* Info.plist */, 149 | ); 150 | path = DashboardUITests; 151 | sourceTree = ""; 152 | }; 153 | /* End PBXGroup section */ 154 | 155 | /* Begin PBXNativeTarget section */ 156 | 5EC81B8F22A8C146004E4A88 /* Dashboard */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 5EC81BBC22A8C146004E4A88 /* Build configuration list for PBXNativeTarget "Dashboard" */; 159 | buildPhases = ( 160 | 5EC81B8C22A8C146004E4A88 /* Sources */, 161 | 5EC81B8D22A8C146004E4A88 /* Frameworks */, 162 | 5EC81B8E22A8C146004E4A88 /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = Dashboard; 169 | productName = Dashboard; 170 | productReference = 5EC81B9022A8C146004E4A88 /* Dashboard.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | 5EC81BA722A8C146004E4A88 /* DashboardTests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 5EC81BBF22A8C146004E4A88 /* Build configuration list for PBXNativeTarget "DashboardTests" */; 176 | buildPhases = ( 177 | 5EC81BA422A8C146004E4A88 /* Sources */, 178 | 5EC81BA522A8C146004E4A88 /* Frameworks */, 179 | 5EC81BA622A8C146004E4A88 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 5EC81BAA22A8C146004E4A88 /* PBXTargetDependency */, 185 | ); 186 | name = DashboardTests; 187 | productName = DashboardTests; 188 | productReference = 5EC81BA822A8C146004E4A88 /* DashboardTests.xctest */; 189 | productType = "com.apple.product-type.bundle.unit-test"; 190 | }; 191 | 5EC81BB222A8C146004E4A88 /* DashboardUITests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 5EC81BC222A8C146004E4A88 /* Build configuration list for PBXNativeTarget "DashboardUITests" */; 194 | buildPhases = ( 195 | 5EC81BAF22A8C146004E4A88 /* Sources */, 196 | 5EC81BB022A8C146004E4A88 /* Frameworks */, 197 | 5EC81BB122A8C146004E4A88 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 5EC81BB522A8C146004E4A88 /* PBXTargetDependency */, 203 | ); 204 | name = DashboardUITests; 205 | productName = DashboardUITests; 206 | productReference = 5EC81BB322A8C146004E4A88 /* DashboardUITests.xctest */; 207 | productType = "com.apple.product-type.bundle.ui-testing"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 5EC81B8822A8C146004E4A88 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastUpgradeCheck = 1010; 216 | ORGANIZATIONNAME = "王灵博"; 217 | TargetAttributes = { 218 | 5EC81B8F22A8C146004E4A88 = { 219 | CreatedOnToolsVersion = 10.1; 220 | }; 221 | 5EC81BA722A8C146004E4A88 = { 222 | CreatedOnToolsVersion = 10.1; 223 | TestTargetID = 5EC81B8F22A8C146004E4A88; 224 | }; 225 | 5EC81BB222A8C146004E4A88 = { 226 | CreatedOnToolsVersion = 10.1; 227 | TestTargetID = 5EC81B8F22A8C146004E4A88; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 5EC81B8B22A8C146004E4A88 /* Build configuration list for PBXProject "Dashboard" */; 232 | compatibilityVersion = "Xcode 9.3"; 233 | developmentRegion = en; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | Base, 238 | ); 239 | mainGroup = 5EC81B8722A8C146004E4A88; 240 | productRefGroup = 5EC81B9122A8C146004E4A88 /* Products */; 241 | projectDirPath = ""; 242 | projectRoot = ""; 243 | targets = ( 244 | 5EC81B8F22A8C146004E4A88 /* Dashboard */, 245 | 5EC81BA722A8C146004E4A88 /* DashboardTests */, 246 | 5EC81BB222A8C146004E4A88 /* DashboardUITests */, 247 | ); 248 | }; 249 | /* End PBXProject section */ 250 | 251 | /* Begin PBXResourcesBuildPhase section */ 252 | 5EC81B8E22A8C146004E4A88 /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 5EC81BA022A8C146004E4A88 /* LaunchScreen.storyboard in Resources */, 257 | 5EC81B9D22A8C146004E4A88 /* Assets.xcassets in Resources */, 258 | 5EC81B9B22A8C146004E4A88 /* Main.storyboard in Resources */, 259 | 5EC81BCF22A8DE61004E4A88 /* circle.png in Resources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 5EC81BA622A8C146004E4A88 /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 5EC81BB122A8C146004E4A88 /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | /* End PBXResourcesBuildPhase section */ 278 | 279 | /* Begin PBXSourcesBuildPhase section */ 280 | 5EC81B8C22A8C146004E4A88 /* Sources */ = { 281 | isa = PBXSourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | 5EC81BCD22A8C1D3004E4A88 /* Dashboard.m in Sources */, 285 | 5EC81BCA22A8C1B4004E4A88 /* UIView+Extension.m in Sources */, 286 | 5EC81B9822A8C146004E4A88 /* ViewController.m in Sources */, 287 | 5EC81BA322A8C146004E4A88 /* main.m in Sources */, 288 | 5EC81B9522A8C146004E4A88 /* AppDelegate.m in Sources */, 289 | 5EC81BC922A8C1B4004E4A88 /* UIColor+Extension.m in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | 5EC81BA422A8C146004E4A88 /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | 5EC81BAD22A8C146004E4A88 /* DashboardTests.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | 5EC81BAF22A8C146004E4A88 /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | 5EC81BB822A8C146004E4A88 /* DashboardUITests.m in Sources */, 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | /* End PBXSourcesBuildPhase section */ 310 | 311 | /* Begin PBXTargetDependency section */ 312 | 5EC81BAA22A8C146004E4A88 /* PBXTargetDependency */ = { 313 | isa = PBXTargetDependency; 314 | target = 5EC81B8F22A8C146004E4A88 /* Dashboard */; 315 | targetProxy = 5EC81BA922A8C146004E4A88 /* PBXContainerItemProxy */; 316 | }; 317 | 5EC81BB522A8C146004E4A88 /* PBXTargetDependency */ = { 318 | isa = PBXTargetDependency; 319 | target = 5EC81B8F22A8C146004E4A88 /* Dashboard */; 320 | targetProxy = 5EC81BB422A8C146004E4A88 /* PBXContainerItemProxy */; 321 | }; 322 | /* End PBXTargetDependency section */ 323 | 324 | /* Begin PBXVariantGroup section */ 325 | 5EC81B9922A8C146004E4A88 /* Main.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 5EC81B9A22A8C146004E4A88 /* Base */, 329 | ); 330 | name = Main.storyboard; 331 | sourceTree = ""; 332 | }; 333 | 5EC81B9E22A8C146004E4A88 /* LaunchScreen.storyboard */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | 5EC81B9F22A8C146004E4A88 /* Base */, 337 | ); 338 | name = LaunchScreen.storyboard; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 5EC81BBA22A8C146004E4A88 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | CLANG_ANALYZER_NONNULL = YES; 349 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 351 | CLANG_CXX_LIBRARY = "libc++"; 352 | CLANG_ENABLE_MODULES = YES; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | CLANG_ENABLE_OBJC_WEAK = YES; 355 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_COMMA = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 361 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INFINITE_RECURSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 367 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 368 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 369 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 370 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 371 | CLANG_WARN_STRICT_PROTOTYPES = YES; 372 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 373 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 374 | CLANG_WARN_UNREACHABLE_CODE = YES; 375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 376 | CODE_SIGN_IDENTITY = "iPhone Developer"; 377 | COPY_PHASE_STRIP = NO; 378 | DEBUG_INFORMATION_FORMAT = dwarf; 379 | ENABLE_STRICT_OBJC_MSGSEND = YES; 380 | ENABLE_TESTABILITY = YES; 381 | GCC_C_LANGUAGE_STANDARD = gnu11; 382 | GCC_DYNAMIC_NO_PIC = NO; 383 | GCC_NO_COMMON_BLOCKS = YES; 384 | GCC_OPTIMIZATION_LEVEL = 0; 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 391 | GCC_WARN_UNDECLARED_SELECTOR = YES; 392 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 393 | GCC_WARN_UNUSED_FUNCTION = YES; 394 | GCC_WARN_UNUSED_VARIABLE = YES; 395 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 396 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 397 | MTL_FAST_MATH = YES; 398 | ONLY_ACTIVE_ARCH = YES; 399 | SDKROOT = iphoneos; 400 | }; 401 | name = Debug; 402 | }; 403 | 5EC81BBB22A8C146004E4A88 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_ANALYZER_NONNULL = YES; 408 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 409 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 410 | CLANG_CXX_LIBRARY = "libc++"; 411 | CLANG_ENABLE_MODULES = YES; 412 | CLANG_ENABLE_OBJC_ARC = YES; 413 | CLANG_ENABLE_OBJC_WEAK = YES; 414 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 415 | CLANG_WARN_BOOL_CONVERSION = YES; 416 | CLANG_WARN_COMMA = YES; 417 | CLANG_WARN_CONSTANT_CONVERSION = YES; 418 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 419 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 420 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 421 | CLANG_WARN_EMPTY_BODY = YES; 422 | CLANG_WARN_ENUM_CONVERSION = YES; 423 | CLANG_WARN_INFINITE_RECURSION = YES; 424 | CLANG_WARN_INT_CONVERSION = YES; 425 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 426 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = 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 = 12.1; 449 | MTL_ENABLE_DEBUG_INFO = NO; 450 | MTL_FAST_MATH = YES; 451 | SDKROOT = iphoneos; 452 | VALIDATE_PRODUCT = YES; 453 | }; 454 | name = Release; 455 | }; 456 | 5EC81BBD22A8C146004E4A88 /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 460 | CODE_SIGN_STYLE = Automatic; 461 | INFOPLIST_FILE = Dashboard/Info.plist; 462 | LD_RUNPATH_SEARCH_PATHS = ( 463 | "$(inherited)", 464 | "@executable_path/Frameworks", 465 | ); 466 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.Dashboard; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | TARGETED_DEVICE_FAMILY = "1,2"; 469 | }; 470 | name = Debug; 471 | }; 472 | 5EC81BBE22A8C146004E4A88 /* Release */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 476 | CODE_SIGN_STYLE = Automatic; 477 | INFOPLIST_FILE = Dashboard/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = ( 479 | "$(inherited)", 480 | "@executable_path/Frameworks", 481 | ); 482 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.Dashboard; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TARGETED_DEVICE_FAMILY = "1,2"; 485 | }; 486 | name = Release; 487 | }; 488 | 5EC81BC022A8C146004E4A88 /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | BUNDLE_LOADER = "$(TEST_HOST)"; 492 | CODE_SIGN_STYLE = Automatic; 493 | INFOPLIST_FILE = DashboardTests/Info.plist; 494 | LD_RUNPATH_SEARCH_PATHS = ( 495 | "$(inherited)", 496 | "@executable_path/Frameworks", 497 | "@loader_path/Frameworks", 498 | ); 499 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.DashboardTests; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | TARGETED_DEVICE_FAMILY = "1,2"; 502 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Dashboard.app/Dashboard"; 503 | }; 504 | name = Debug; 505 | }; 506 | 5EC81BC122A8C146004E4A88 /* Release */ = { 507 | isa = XCBuildConfiguration; 508 | buildSettings = { 509 | BUNDLE_LOADER = "$(TEST_HOST)"; 510 | CODE_SIGN_STYLE = Automatic; 511 | INFOPLIST_FILE = DashboardTests/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = ( 513 | "$(inherited)", 514 | "@executable_path/Frameworks", 515 | "@loader_path/Frameworks", 516 | ); 517 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.DashboardTests; 518 | PRODUCT_NAME = "$(TARGET_NAME)"; 519 | TARGETED_DEVICE_FAMILY = "1,2"; 520 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Dashboard.app/Dashboard"; 521 | }; 522 | name = Release; 523 | }; 524 | 5EC81BC322A8C146004E4A88 /* Debug */ = { 525 | isa = XCBuildConfiguration; 526 | buildSettings = { 527 | CODE_SIGN_STYLE = Automatic; 528 | INFOPLIST_FILE = DashboardUITests/Info.plist; 529 | LD_RUNPATH_SEARCH_PATHS = ( 530 | "$(inherited)", 531 | "@executable_path/Frameworks", 532 | "@loader_path/Frameworks", 533 | ); 534 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.DashboardUITests; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | TEST_TARGET_NAME = Dashboard; 538 | }; 539 | name = Debug; 540 | }; 541 | 5EC81BC422A8C146004E4A88 /* Release */ = { 542 | isa = XCBuildConfiguration; 543 | buildSettings = { 544 | CODE_SIGN_STYLE = Automatic; 545 | INFOPLIST_FILE = DashboardUITests/Info.plist; 546 | LD_RUNPATH_SEARCH_PATHS = ( 547 | "$(inherited)", 548 | "@executable_path/Frameworks", 549 | "@loader_path/Frameworks", 550 | ); 551 | PRODUCT_BUNDLE_IDENTIFIER = com.boe.com.DashboardUITests; 552 | PRODUCT_NAME = "$(TARGET_NAME)"; 553 | TARGETED_DEVICE_FAMILY = "1,2"; 554 | TEST_TARGET_NAME = Dashboard; 555 | }; 556 | name = Release; 557 | }; 558 | /* End XCBuildConfiguration section */ 559 | 560 | /* Begin XCConfigurationList section */ 561 | 5EC81B8B22A8C146004E4A88 /* Build configuration list for PBXProject "Dashboard" */ = { 562 | isa = XCConfigurationList; 563 | buildConfigurations = ( 564 | 5EC81BBA22A8C146004E4A88 /* Debug */, 565 | 5EC81BBB22A8C146004E4A88 /* Release */, 566 | ); 567 | defaultConfigurationIsVisible = 0; 568 | defaultConfigurationName = Release; 569 | }; 570 | 5EC81BBC22A8C146004E4A88 /* Build configuration list for PBXNativeTarget "Dashboard" */ = { 571 | isa = XCConfigurationList; 572 | buildConfigurations = ( 573 | 5EC81BBD22A8C146004E4A88 /* Debug */, 574 | 5EC81BBE22A8C146004E4A88 /* Release */, 575 | ); 576 | defaultConfigurationIsVisible = 0; 577 | defaultConfigurationName = Release; 578 | }; 579 | 5EC81BBF22A8C146004E4A88 /* Build configuration list for PBXNativeTarget "DashboardTests" */ = { 580 | isa = XCConfigurationList; 581 | buildConfigurations = ( 582 | 5EC81BC022A8C146004E4A88 /* Debug */, 583 | 5EC81BC122A8C146004E4A88 /* Release */, 584 | ); 585 | defaultConfigurationIsVisible = 0; 586 | defaultConfigurationName = Release; 587 | }; 588 | 5EC81BC222A8C146004E4A88 /* Build configuration list for PBXNativeTarget "DashboardUITests" */ = { 589 | isa = XCConfigurationList; 590 | buildConfigurations = ( 591 | 5EC81BC322A8C146004E4A88 /* Debug */, 592 | 5EC81BC422A8C146004E4A88 /* Release */, 593 | ); 594 | defaultConfigurationIsVisible = 0; 595 | defaultConfigurationName = Release; 596 | }; 597 | /* End XCConfigurationList section */ 598 | }; 599 | rootObject = 5EC81B8822A8C146004E4A88 /* Project object */; 600 | } 601 | -------------------------------------------------------------------------------- /Dashboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Dashboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Dashboard.xcodeproj/project.xcworkspace/xcuserdata/wanglingbo1.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Superwang888/Dashboard/c77afd3ce1e34db34f9a1f49974b9557348e0f55/Dashboard.xcodeproj/project.xcworkspace/xcuserdata/wanglingbo1.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Dashboard.xcodeproj/xcuserdata/wanglingbo1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Dashboard.xcodeproj/xcuserdata/wanglingbo1.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Dashboard.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Dashboard/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 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 | -------------------------------------------------------------------------------- /Dashboard/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 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 | -------------------------------------------------------------------------------- /Dashboard/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 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Dashboard/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Dashboard/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 | -------------------------------------------------------------------------------- /Dashboard/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 | -------------------------------------------------------------------------------- /Dashboard/Dashboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // Dashboard.h 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface Dashboard : UIView 14 | @property(nonatomic,assign)NSInteger process; 15 | -(void)beginTransForm; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Dashboard/Dashboard.m: -------------------------------------------------------------------------------- 1 | // 2 | // Dashboard.m 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import "Dashboard.h" 10 | #import "UIView+Extension.h" 11 | #import "UIColor+Extension.h" 12 | @interface Dashboard () 13 | @property(nonatomic,strong)UIView *transformView; 14 | @property(nonatomic,assign)CGFloat number; 15 | @end 16 | @implementation Dashboard 17 | 18 | -(instancetype)initWithFrame:(CGRect)frame 19 | { 20 | if (self=[super initWithFrame:frame]) { 21 | //self.backgroundColor=[UIColor greenColor]; 22 | self.number=0; 23 | [self drawBorder]; 24 | [self drawScale]; 25 | [self addScaleLable]; 26 | [self addGrayCircle]; 27 | [self drawTransform]; 28 | [self addSubview:self.transformView]; 29 | [self drawTriangle]; 30 | } 31 | return self; 32 | } 33 | -(void)drawBorder 34 | { 35 | //startAngle和endAngle详见circle图 36 | UIBezierPath *cicrle=[UIBezierPath bezierPathWithArcCenter:CGPointMake(self.width/2.f, self.height/2.f) 37 | radius:(self.width-10)/2.f 38 | startAngle:M_PI*(3.f/4) 39 | endAngle:M_PI/4.f 40 | clockwise:YES]; 41 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 42 | shapeLayer.lineWidth = 10.f; 43 | shapeLayer.fillColor = [UIColor clearColor].CGColor; 44 | shapeLayer.strokeColor = [UIColor redColor].CGColor; 45 | shapeLayer.path = cicrle.CGPath; 46 | 47 | [self.layer addSublayer:shapeLayer]; 48 | 49 | 50 | UIColor*color1 = [UIColor colorWithHexString:@"#6FC02F"]; 51 | UIColor*color2 = [UIColor colorWithHexString:@"#F1E737"]; 52 | UIColor*color3 = [UIColor colorWithHexString:@"#F14010"]; 53 | 54 | CAGradientLayer*gradientLayer = [CAGradientLayer layer]; 55 | 56 | gradientLayer.frame=self.bounds; 57 | 58 | [gradientLayer setColors:[NSArray arrayWithObjects:(id)color1.CGColor,(id)color2.CGColor,(id)color3.CGColor,nil]]; 59 | 60 | gradientLayer.startPoint=CGPointMake(0,1); 61 | 62 | gradientLayer.endPoint=CGPointMake(1,1); 63 | 64 | [gradientLayer setMask:shapeLayer]; //用progressLayer来截取渐变层 65 | 66 | [self.layer addSublayer:gradientLayer]; 67 | } 68 | -(void)drawScale 69 | { 70 | CGFloat scale=((6.f/4)*M_PI)/100.f; 71 | for (int i=0; i<101; i++) { 72 | CGPoint point=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(-M_PI/4.f+scale*i) andWithRadius:(self.width-20)/2.f]; 73 | 74 | UIBezierPath *line=[UIBezierPath bezierPath]; 75 | [line moveToPoint:point]; 76 | [line addLineToPoint:CGPointMake(self.width/2.f, self.height/2.f)]; 77 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 78 | if (i%10==0) { 79 | shapeLayer.strokeStart=0; 80 | shapeLayer.strokeEnd=0.1; 81 | }else 82 | { 83 | shapeLayer.strokeStart=0; 84 | shapeLayer.strokeEnd=0.05; 85 | } 86 | shapeLayer.lineWidth = 0.5f; 87 | shapeLayer.fillColor = [UIColor clearColor].CGColor; 88 | shapeLayer.strokeColor = [UIColor colorWithHexString:@"#979DA0"].CGColor; 89 | shapeLayer.path = line.CGPath; 90 | 91 | [self.layer addSublayer:shapeLayer]; 92 | } 93 | 94 | 95 | } 96 | -(void)addScaleLable 97 | { 98 | CGFloat scale=((6.f/4)*M_PI)/100.f; 99 | for (int i=0; i<11; i++) { 100 | CGFloat angle=(-M_PI/4.f+scale*i*10); 101 | CGPoint point=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:angle andWithRadius:(self.width-40)/2.f]; 102 | UILabel *text = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 10)]; 103 | text.center=point; 104 | text.text = [NSString stringWithFormat:@"%ld",100-i*10]; 105 | text.font = [UIFont fontWithName:@"PingFangSC-Regular" size: 10]; 106 | text.textColor = [UIColor colorWithHexString:@"#979DA0"]; 107 | text.textAlignment = NSTextAlignmentCenter; 108 | [self addSubview:text]; 109 | 110 | //旋转lable,旋转开始的位置都不同,再次转换 111 | CGFloat transformAngle=((3*M_PI)/4.f)-(scale*i*10); 112 | text.transform = CGAffineTransformRotate(text.transform, transformAngle);//控件 113 | 114 | } 115 | } 116 | /** 117 | 设置缩放或旋转围绕的点 118 | 119 | @param anchorPoint 围绕的点 120 | @param view 设置的视图 121 | */ 122 | //- (void)setAnchorPoint:(CGPoint)anchorPoint forView:(UIView *)view { 123 | // 124 | // CGPoint oldOrigin = view.frame.origin; 125 | // view.layer.anchorPoint = anchorPoint; 126 | // 127 | // 128 | // CGPoint newOrigin = view.frame.origin; 129 | // 130 | // CGPoint transition; 131 | // transition.x = newOrigin.x - oldOrigin.x; 132 | // transition.y = newOrigin.y - oldOrigin.y; 133 | // 134 | // view.center = CGPointMake (view.center.x - transition.x, view.center.y - transition.y); 135 | // 136 | //} 137 | - (void)setAnchorPoint:(CGPoint)anchorpoint forView:(UIView *)view{ 138 | CGRect oldFrame=view.frame; 139 | view.layer.anchorPoint = anchorpoint; 140 | view.frame = oldFrame; 141 | } 142 | -(void)addGrayCircle 143 | { 144 | UIBezierPath *cicrle=[UIBezierPath bezierPathWithArcCenter:CGPointMake(self.width/2.f, self.height/2.f) 145 | radius:(self.width-100)/2.f 146 | startAngle:M_PI*(3.f/4) 147 | endAngle:M_PI/4.f 148 | clockwise:YES]; 149 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 150 | shapeLayer.lineWidth = 25.f; 151 | shapeLayer.fillColor = [UIColor clearColor].CGColor; 152 | shapeLayer.strokeColor = [UIColor colorWithHexString:@"#EEEEEE"].CGColor; 153 | shapeLayer.path = cicrle.CGPath; 154 | 155 | [self.layer addSublayer:shapeLayer]; 156 | 157 | } 158 | -(void)drawTransform 159 | { 160 | UIBezierPath *cicrle=[UIBezierPath bezierPathWithArcCenter:CGPointMake(self.width/2.f, self.height/2.f) 161 | radius:7.5 162 | startAngle:0 163 | endAngle:2*M_PI 164 | clockwise:YES]; 165 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 166 | shapeLayer.fillColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 167 | shapeLayer.strokeColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 168 | shapeLayer.path = cicrle.CGPath; 169 | 170 | [self.layer addSublayer:shapeLayer]; 171 | 172 | 173 | 174 | } 175 | //-(void)drawTriangle 176 | //{ 177 | // 178 | // CGPoint point=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(5*M_PI/4.f) andWithRadius:(self.width-60)/2.f]; 179 | // CGPoint point1=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(-M_PI/4.f) andWithRadius:2.f]; 180 | // 181 | // CGPoint point2=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(3*M_PI/4.f) andWithRadius:2.f]; 182 | // 183 | // UIBezierPath *line=[UIBezierPath bezierPath]; 184 | // [line moveToPoint:point1]; 185 | // [line addLineToPoint:point]; 186 | // [line addLineToPoint:point2]; 187 | // CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 188 | // 189 | // shapeLayer.fillColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 190 | // shapeLayer.strokeColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 191 | // shapeLayer.path = line.CGPath; 192 | // 193 | // [self.layer addSublayer:shapeLayer]; 194 | // 195 | //} 196 | -(void)drawTriangle 197 | { 198 | 199 | CGPoint point=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(5*M_PI/4.f) andWithRadius:(self.width-60)/2.f]; 200 | CGPoint point1=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(-M_PI/4.f) andWithRadius:2.f]; 201 | 202 | CGPoint point2=[self calcCircleCoordinateWithCenter:CGPointMake(self.width/2.f, self.height/2.f) andWithAngle:(3*M_PI/4.f) andWithRadius:2.f]; 203 | 204 | CGPoint coverPoint=[self convertPoint:point toView:self.transformView]; 205 | CGPoint coverPoint1=[self convertPoint:point1 toView:self.transformView]; 206 | CGPoint coverPoint2=[self convertPoint:point2 toView:self.transformView]; 207 | 208 | UIBezierPath *line=[UIBezierPath bezierPath]; 209 | [line moveToPoint:coverPoint1]; 210 | [line addLineToPoint:coverPoint]; 211 | [line addLineToPoint:coverPoint2]; 212 | CAShapeLayer *shapeLayer = [CAShapeLayer layer]; 213 | 214 | shapeLayer.fillColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 215 | shapeLayer.strokeColor = [UIColor colorWithHexString:@"#2E3030"].CGColor; 216 | shapeLayer.path = line.CGPath; 217 | 218 | [self.transformView.layer addSublayer:shapeLayer]; 219 | 220 | } 221 | -(void)setProcess:(NSInteger)process 222 | { 223 | _process=process; 224 | CGFloat scale=((6.f/4)*M_PI)/100.f; 225 | CGFloat transformAngle=scale*process; 226 | self.transformView.transform = CGAffineTransformRotate(self.transformView.transform, transformAngle);//控件 227 | self.number=process; 228 | } 229 | -(void)beginTransForm 230 | { 231 | [self performSelector:@selector(transsss) withObject:nil afterDelay:1]; 232 | } 233 | -(void)transsss 234 | { 235 | if (self.number>=100) { 236 | self.number=0; 237 | self.transformView.transform=CGAffineTransformIdentity; 238 | } 239 | CGFloat scale=((6.f/4)*M_PI)/100.f; 240 | CGFloat transformAngle=scale; 241 | self.transformView.transform = CGAffineTransformRotate(self.transformView.transform, transformAngle);//控件 242 | self.number= self.number+1; 243 | [self performSelector:@selector(transsss) withObject:nil afterDelay:1]; 244 | 245 | } 246 | CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float centerY ,float x ,float y ,float angle) 247 | { 248 | x = x - centerX; //计算(x,y)从(0,0)为原点的坐标系变换到(CenterX ,CenterY)为原点的坐标系下的坐标 249 | y = y - centerY; //(0,0)坐标系的右横轴、下竖轴是正轴,(CenterX,CenterY)坐标系的正轴也一样 250 | 251 | CGAffineTransform trans = CGAffineTransformMakeTranslation(x, y); 252 | trans = CGAffineTransformRotate(trans,angle); 253 | trans = CGAffineTransformTranslate(trans,-x, -y); 254 | return trans; 255 | 256 | } 257 | -(UIView *)transformView 258 | { 259 | if (_transformView==nil) { 260 | _transformView=[[UIView alloc] init]; 261 | _transformView.frame=CGRectMake(0,self.height/2.f,(self.width-90)/2.f , (self.width-90)/2.f); 262 | _transformView.backgroundColor=[UIColor clearColor]; 263 | _transformView.center=CGPointMake(self.width/2.f, self.height/2.f); 264 | 265 | } 266 | return _transformView; 267 | } 268 | #pragma mark 计算圆圈上点在IOS系统中的坐标 269 | -(CGPoint)calcCircleCoordinateWithCenter:(CGPoint)center andWithAngle : (CGFloat) angle andWithRadius: (CGFloat) radius{ 270 | CGFloat x2 = radius*cosf(angle); 271 | CGFloat y2 = radius*sinf(angle); 272 | return CGPointMake(center.x+x2, center.y-y2); 273 | } 274 | @end 275 | -------------------------------------------------------------------------------- /Dashboard/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 | -------------------------------------------------------------------------------- /Dashboard/UIColor+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.h 3 | // Wlb 4 | // 5 | // Created by 王灵博 on 2019/1/4. 6 | // Copyright © 2019年 王灵博. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface UIColor (Extension) 13 | + (UIColor *)colorWithHexString:(NSString *)hexString; 14 | + (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpaha; 15 | #pragma 获取图片主色调 16 | +(UIColor*)mostColorWithimageName:(NSString *)imgName; 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Dashboard/UIColor+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.m 3 | // Wlb 4 | // 5 | // Created by 王灵博 on 2019/1/4. 6 | // Copyright © 2019年 王灵博. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Extension.h" 10 | 11 | @implementation UIColor (Extension) 12 | + (UIColor *)colorWithHexString:(NSString *)hexString 13 | { 14 | NSString *cString = [[hexString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; 15 | 16 | //hexString应该6到8个字符 17 | if ([cString length] < 6) { 18 | return [UIColor clearColor]; 19 | } 20 | 21 | //如果hexString 有@"0X"前缀 22 | if ([cString hasPrefix:@"0X"]) 23 | cString = [cString substringFromIndex:2]; 24 | 25 | //如果hexString 有@"#""前缀 26 | if ([cString hasPrefix:@"#"]) 27 | cString = [cString substringFromIndex:1]; 28 | if ([cString length] != 6) 29 | return [UIColor clearColor]; 30 | 31 | //RGB转换 32 | NSRange range; 33 | range.location = 0; 34 | range.length = 2; 35 | 36 | //R 37 | NSString *rString = [cString substringWithRange:range]; 38 | 39 | //G 40 | range.location = 2; 41 | NSString *gString = [cString substringWithRange:range]; 42 | 43 | //B 44 | range.location = 4; 45 | NSString *bString = [cString substringWithRange:range]; 46 | 47 | // 48 | unsigned int r, g, b; 49 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 50 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 51 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 52 | 53 | return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:1.0f]; 54 | } 55 | 56 | + (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpaha 57 | { 58 | NSString *cString = [[hexString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; 59 | 60 | //hexString应该6到8个字符 61 | if ([cString length] < 6) { 62 | return [UIColor clearColor]; 63 | } 64 | 65 | //如果hexString 有@"0X"前缀 66 | if ([cString hasPrefix:@"0X"]) 67 | cString = [cString substringFromIndex:2]; 68 | 69 | //如果hexString 有@"#""前缀 70 | if ([cString hasPrefix:@"#"]) 71 | cString = [cString substringFromIndex:1]; 72 | if ([cString length] != 6) 73 | return [UIColor clearColor]; 74 | 75 | //RGB转换 76 | NSRange range; 77 | range.location = 0; 78 | range.length = 2; 79 | 80 | //R 81 | NSString *rString = [cString substringWithRange:range]; 82 | 83 | //G 84 | range.location = 2; 85 | NSString *gString = [cString substringWithRange:range]; 86 | 87 | //B 88 | range.location = 4; 89 | NSString *bString = [cString substringWithRange:range]; 90 | 91 | // 92 | unsigned int r, g, b; 93 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 94 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 95 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 96 | 97 | return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:alpaha]; 98 | } 99 | #pragma 获取图片主色调 100 | +(UIColor*)mostColorWithimageName:(NSString *)imgName{ 101 | 102 | 103 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1 104 | int bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast; 105 | #else 106 | int bitmapInfo = kCGImageAlphaPremultipliedLast; 107 | #endif 108 | 109 | //第一步 先把图片缩小 加快计算速度. 但越小结果误差可能越大 110 | CGSize thumbSize=CGSizeMake(50, 50); 111 | 112 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 113 | CGContextRef context = CGBitmapContextCreate(NULL, 114 | thumbSize.width, 115 | thumbSize.height, 116 | 8,//bits per component 117 | thumbSize.width*4, 118 | colorSpace, 119 | bitmapInfo); 120 | 121 | CGRect drawRect = CGRectMake(0, 0, thumbSize.width, thumbSize.height); 122 | CGContextDrawImage(context, drawRect,[UIImage imageNamed:imgName].CGImage); 123 | CGColorSpaceRelease(colorSpace); 124 | 125 | 126 | 127 | //第二步 取每个点的像素值 128 | unsigned char* data = CGBitmapContextGetData (context); 129 | 130 | if (data == NULL) return nil; 131 | 132 | NSCountedSet *cls=[NSCountedSet setWithCapacity:thumbSize.width*thumbSize.height]; 133 | 134 | for (int x=0; x 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (Extension) 14 | @property (nonatomic, assign) CGFloat width; 15 | 16 | @property (nonatomic, assign) CGFloat height; 17 | 18 | @property (nonatomic, assign) CGFloat x; 19 | 20 | @property (nonatomic, assign) CGFloat y; 21 | 22 | @property (nonatomic) CGFloat centerX; 23 | 24 | @property (nonatomic) CGFloat centerY; 25 | 26 | @property (nonatomic) CGSize size; 27 | 28 | @property (nonatomic) CGFloat top; 29 | 30 | @property (nonatomic) CGFloat left; 31 | 32 | @property (nonatomic) CGFloat right; 33 | 34 | @property (nonatomic) CGFloat bottom; 35 | 36 | -(void)addCornerRadii:(CGFloat)radii; 37 | -(void)addCornerWithBorderRadii:(CGFloat)radii 38 | borderLineWidth:(CGFloat)lineWidth 39 | borderColor:(UIColor *)borderColor; 40 | -(void)addCornerRadii:(UIRectCorner)roundingCorners Radii:(CGFloat)radii; 41 | -(void)addCornerOriginRoundingCorners:(UIRectCorner)roundingCorners 42 | cornerRadii:(CGSize)cornerRadii 43 | borderLineWidth:(CGFloat)lineWidth 44 | borderColor:(UIColor *)borderColor; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | -------------------------------------------------------------------------------- /Dashboard/UIView+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // Wlb 4 | // 5 | // Created by 王灵博 on 2019/1/9. 6 | // Copyright © 2019年 王灵博. All rights reserved. 7 | // 8 | 9 | #import "UIView+Extension.h" 10 | 11 | @implementation UIView (Extension) 12 | - (void)setWidth:(CGFloat)width { 13 | 14 | CGRect frame = self.frame; 15 | frame.size.width = width; 16 | self.frame = frame; 17 | } 18 | 19 | - (CGFloat)width { 20 | 21 | return self.frame.size.width; 22 | } 23 | 24 | - (void)setHeight:(CGFloat)height { 25 | 26 | CGRect frame = self.frame; 27 | frame.size.height = height; 28 | self.frame = frame; 29 | } 30 | 31 | - (CGFloat)height { 32 | return self.frame.size.height; 33 | } 34 | 35 | - (void)setX:(CGFloat)x { 36 | 37 | CGRect frame = self.frame; 38 | frame.origin.x = x; 39 | self.frame = frame; 40 | } 41 | 42 | - (CGFloat)x { 43 | return self.frame.origin.x; 44 | } 45 | 46 | - (void)setY:(CGFloat)y { 47 | 48 | CGRect frame = self.frame; 49 | frame.origin.y = y; 50 | self.frame = frame; 51 | } 52 | 53 | - (CGFloat)y { 54 | return self.frame.origin.y; 55 | } 56 | 57 | - (CGFloat)centerX { 58 | 59 | return self.x + self.width * 0.5; 60 | } 61 | 62 | - (void)setCenterX:(CGFloat)centerX { 63 | 64 | self.x = centerX - self.width * 0.5; 65 | } 66 | 67 | - (CGFloat)centerY { 68 | 69 | return self.center.y; 70 | } 71 | 72 | - (void)setCenterY:(CGFloat)centerY { 73 | 74 | self.center = CGPointMake(self.center.x, centerY); 75 | } 76 | 77 | - (CGSize)size { 78 | return self.frame.size; 79 | } 80 | 81 | - (void)setSize:(CGSize)size { 82 | 83 | CGRect frame = self.frame; 84 | frame.size = size; 85 | self.frame = frame; 86 | } 87 | - (CGFloat)top { 88 | return self.frame.origin.y; 89 | } 90 | 91 | 92 | - (void)setTop:(CGFloat)y { 93 | CGRect frame = self.frame; 94 | frame.origin.y = y; 95 | self.frame = frame; 96 | } 97 | 98 | 99 | - (CGFloat)right { 100 | return self.frame.origin.x + self.frame.size.width; 101 | } 102 | 103 | 104 | - (void)setRight:(CGFloat)right { 105 | CGRect frame = self.frame; 106 | frame.origin.x = right - frame.size.width; 107 | self.frame = frame; 108 | } 109 | 110 | 111 | - (CGFloat)bottom { 112 | return self.frame.origin.y + self.frame.size.height; 113 | } 114 | 115 | 116 | - (void)setBottom:(CGFloat)bottom { 117 | CGRect frame = self.frame; 118 | frame.origin.y = bottom - frame.size.height; 119 | self.frame = frame; 120 | } 121 | - (CGFloat)left { 122 | return self.frame.origin.x; 123 | } 124 | 125 | 126 | - (void)setLeft:(CGFloat)x { 127 | CGRect frame = self.frame; 128 | frame.origin.x = x; 129 | self.frame = frame; 130 | } 131 | 132 | -(void)addCornerRadii:(CGFloat)radii 133 | { 134 | [self addCornerOriginRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radii, radii) borderLineWidth:0 borderColor:nil]; 135 | } 136 | -(void)addCornerRadii:(UIRectCorner)roundingCorners Radii:(CGFloat)radii 137 | { 138 | [self addCornerOriginRoundingCorners:roundingCorners cornerRadii:CGSizeMake(radii, radii) borderLineWidth:0 borderColor:nil]; 139 | } 140 | -(void)addCornerWithBorderRadii:(CGFloat)radii borderLineWidth:(CGFloat)lineWidth borderColor:(UIColor *)borderColor 141 | { 142 | [self addCornerOriginRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radii, radii) borderLineWidth:lineWidth borderColor:borderColor]; 143 | } 144 | -(void)addCornerOriginRoundingCorners:(UIRectCorner)roundingCorners 145 | cornerRadii:(CGSize)cornerRadii 146 | borderLineWidth:(CGFloat)lineWidth 147 | borderColor:(UIColor *)borderColor 148 | { 149 | UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:roundingCorners cornerRadii:cornerRadii]; 150 | 151 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init]; 152 | 153 | //设置大小 154 | maskLayer.frame = self.bounds; 155 | //设置图形样子 156 | maskLayer.path = maskPath.CGPath; 157 | self.layer.mask = maskLayer; 158 | 159 | if (lineWidth!=0) { 160 | CAShapeLayer *borderLayer=[CAShapeLayer layer]; 161 | borderLayer.path= maskPath.CGPath; 162 | borderLayer.fillColor= [UIColor clearColor].CGColor; 163 | borderLayer.strokeColor= borderColor.CGColor; 164 | borderLayer.lineWidth= lineWidth; 165 | borderLayer.frame=self.bounds; 166 | [self.layer addSublayer:borderLayer]; 167 | } 168 | 169 | } 170 | @end 171 | -------------------------------------------------------------------------------- /Dashboard/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Dashboard/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "Dashboard.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | Dashboard *dash=[[Dashboard alloc] initWithFrame:CGRectMake(100, 100, 180, 180)]; 21 | dash.process=75; 22 | [dash beginTransForm]; 23 | [self.view addSubview:dash]; 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Dashboard/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Dashboard 4 | // 5 | // Created by 王灵博 on 2019/6/6. 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 | -------------------------------------------------------------------------------- /DashboardTests/DashboardTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DashboardTests.m 3 | // DashboardTests 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DashboardTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DashboardTests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | } 20 | 21 | - (void)tearDown { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | // Use XCTAssert and related functions to verify your tests produce the correct results. 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /DashboardTests/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 | -------------------------------------------------------------------------------- /DashboardUITests/DashboardUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DashboardUITests.m 3 | // DashboardUITests 4 | // 5 | // Created by 王灵博 on 2019/6/6. 6 | // Copyright © 2019 王灵博. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DashboardUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DashboardUITests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | 20 | // In UI tests it is usually best to stop immediately when a failure occurs. 21 | self.continueAfterFailure = NO; 22 | 23 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 24 | [[[XCUIApplication alloc] init] launch]; 25 | 26 | // 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. 27 | } 28 | 29 | - (void)tearDown { 30 | // Put teardown code here. This method is called after the invocation of each test method in the class. 31 | } 32 | 33 | - (void)testExample { 34 | // Use recording to get started writing UI tests. 35 | // Use XCTAssert and related functions to verify your tests produce the correct results. 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /DashboardUITests/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dashboard 2 | 史上最美仪表盘 3 | ![image](https://github.com/Superwang888/Dashboard/blob/master/images/WechatIMG.png) 4 | -------------------------------------------------------------------------------- /images/WechatIMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Superwang888/Dashboard/c77afd3ce1e34db34f9a1f49974b9557348e0f55/images/WechatIMG.png -------------------------------------------------------------------------------- /images/picture: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------