├── CYXAudioProgressViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── chaojiwandianshang.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── CYXAudioProgressViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CYXAudioProgressView │ ├── CYXAudioProgressView.h │ └── CYXAudioProgressView.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── QQ20180509-160255-HD.gif └── README.md /CYXAudioProgressViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 55BABC8420A2CB70005320D5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 55BABC8320A2CB70005320D5 /* AppDelegate.m */; }; 11 | 55BABC8720A2CB70005320D5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55BABC8620A2CB70005320D5 /* ViewController.m */; }; 12 | 55BABC8A20A2CB70005320D5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 55BABC8820A2CB70005320D5 /* Main.storyboard */; }; 13 | 55BABC8C20A2CB75005320D5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 55BABC8B20A2CB75005320D5 /* Assets.xcassets */; }; 14 | 55BABC8F20A2CB75005320D5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 55BABC8D20A2CB75005320D5 /* LaunchScreen.storyboard */; }; 15 | 55BABC9220A2CB75005320D5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 55BABC9120A2CB75005320D5 /* main.m */; }; 16 | 55BABC9B20A2CBA4005320D5 /* CYXAudioProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 55BABC9A20A2CBA4005320D5 /* CYXAudioProgressView.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 55BABC7F20A2CB70005320D5 /* CYXAudioProgressViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CYXAudioProgressViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 55BABC8220A2CB70005320D5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 55BABC8320A2CB70005320D5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 55BABC8520A2CB70005320D5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 55BABC8620A2CB70005320D5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 55BABC8920A2CB70005320D5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 55BABC8B20A2CB75005320D5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 55BABC8E20A2CB75005320D5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 55BABC9020A2CB75005320D5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 55BABC9120A2CB75005320D5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 55BABC9920A2CBA4005320D5 /* CYXAudioProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CYXAudioProgressView.h; sourceTree = ""; }; 31 | 55BABC9A20A2CBA4005320D5 /* CYXAudioProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CYXAudioProgressView.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 55BABC7C20A2CB70005320D5 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 55BABC7620A2CB70005320D5 = { 46 | isa = PBXGroup; 47 | children = ( 48 | 55BABC8120A2CB70005320D5 /* CYXAudioProgressViewDemo */, 49 | 55BABC8020A2CB70005320D5 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 55BABC8020A2CB70005320D5 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 55BABC7F20A2CB70005320D5 /* CYXAudioProgressViewDemo.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 55BABC8120A2CB70005320D5 /* CYXAudioProgressViewDemo */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 55BABC9820A2CB92005320D5 /* CYXAudioProgressView */, 65 | 55BABC8220A2CB70005320D5 /* AppDelegate.h */, 66 | 55BABC8320A2CB70005320D5 /* AppDelegate.m */, 67 | 55BABC8520A2CB70005320D5 /* ViewController.h */, 68 | 55BABC8620A2CB70005320D5 /* ViewController.m */, 69 | 55BABC8820A2CB70005320D5 /* Main.storyboard */, 70 | 55BABC8B20A2CB75005320D5 /* Assets.xcassets */, 71 | 55BABC8D20A2CB75005320D5 /* LaunchScreen.storyboard */, 72 | 55BABC9020A2CB75005320D5 /* Info.plist */, 73 | 55BABC9120A2CB75005320D5 /* main.m */, 74 | ); 75 | path = CYXAudioProgressViewDemo; 76 | sourceTree = ""; 77 | }; 78 | 55BABC9820A2CB92005320D5 /* CYXAudioProgressView */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 55BABC9920A2CBA4005320D5 /* CYXAudioProgressView.h */, 82 | 55BABC9A20A2CBA4005320D5 /* CYXAudioProgressView.m */, 83 | ); 84 | path = CYXAudioProgressView; 85 | sourceTree = ""; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 55BABC7E20A2CB70005320D5 /* CYXAudioProgressViewDemo */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 55BABC9520A2CB75005320D5 /* Build configuration list for PBXNativeTarget "CYXAudioProgressViewDemo" */; 93 | buildPhases = ( 94 | 55BABC7B20A2CB70005320D5 /* Sources */, 95 | 55BABC7C20A2CB70005320D5 /* Frameworks */, 96 | 55BABC7D20A2CB70005320D5 /* Resources */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = CYXAudioProgressViewDemo; 103 | productName = CYXAudioProgressViewDemo; 104 | productReference = 55BABC7F20A2CB70005320D5 /* CYXAudioProgressViewDemo.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | 55BABC7720A2CB70005320D5 /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastUpgradeCheck = 0930; 114 | ORGANIZATIONNAME = "超级腕电商"; 115 | TargetAttributes = { 116 | 55BABC7E20A2CB70005320D5 = { 117 | CreatedOnToolsVersion = 9.3; 118 | }; 119 | }; 120 | }; 121 | buildConfigurationList = 55BABC7A20A2CB70005320D5 /* Build configuration list for PBXProject "CYXAudioProgressViewDemo" */; 122 | compatibilityVersion = "Xcode 9.3"; 123 | developmentRegion = en; 124 | hasScannedForEncodings = 0; 125 | knownRegions = ( 126 | en, 127 | Base, 128 | ); 129 | mainGroup = 55BABC7620A2CB70005320D5; 130 | productRefGroup = 55BABC8020A2CB70005320D5 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | 55BABC7E20A2CB70005320D5 /* CYXAudioProgressViewDemo */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | 55BABC7D20A2CB70005320D5 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 55BABC8F20A2CB75005320D5 /* LaunchScreen.storyboard in Resources */, 145 | 55BABC8C20A2CB75005320D5 /* Assets.xcassets in Resources */, 146 | 55BABC8A20A2CB70005320D5 /* Main.storyboard in Resources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXResourcesBuildPhase section */ 151 | 152 | /* Begin PBXSourcesBuildPhase section */ 153 | 55BABC7B20A2CB70005320D5 /* Sources */ = { 154 | isa = PBXSourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 55BABC8720A2CB70005320D5 /* ViewController.m in Sources */, 158 | 55BABC9220A2CB75005320D5 /* main.m in Sources */, 159 | 55BABC8420A2CB70005320D5 /* AppDelegate.m in Sources */, 160 | 55BABC9B20A2CBA4005320D5 /* CYXAudioProgressView.m in Sources */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | /* End PBXSourcesBuildPhase section */ 165 | 166 | /* Begin PBXVariantGroup section */ 167 | 55BABC8820A2CB70005320D5 /* Main.storyboard */ = { 168 | isa = PBXVariantGroup; 169 | children = ( 170 | 55BABC8920A2CB70005320D5 /* Base */, 171 | ); 172 | name = Main.storyboard; 173 | sourceTree = ""; 174 | }; 175 | 55BABC8D20A2CB75005320D5 /* LaunchScreen.storyboard */ = { 176 | isa = PBXVariantGroup; 177 | children = ( 178 | 55BABC8E20A2CB75005320D5 /* Base */, 179 | ); 180 | name = LaunchScreen.storyboard; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXVariantGroup section */ 184 | 185 | /* Begin XCBuildConfiguration section */ 186 | 55BABC9320A2CB75005320D5 /* Debug */ = { 187 | isa = XCBuildConfiguration; 188 | buildSettings = { 189 | ALWAYS_SEARCH_USER_PATHS = NO; 190 | CLANG_ANALYZER_NONNULL = YES; 191 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 192 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 193 | CLANG_CXX_LIBRARY = "libc++"; 194 | CLANG_ENABLE_MODULES = YES; 195 | CLANG_ENABLE_OBJC_ARC = YES; 196 | CLANG_ENABLE_OBJC_WEAK = YES; 197 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_COMMA = YES; 200 | CLANG_WARN_CONSTANT_CONVERSION = YES; 201 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 204 | CLANG_WARN_EMPTY_BODY = YES; 205 | CLANG_WARN_ENUM_CONVERSION = YES; 206 | CLANG_WARN_INFINITE_RECURSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 209 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 210 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 211 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 212 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 213 | CLANG_WARN_STRICT_PROTOTYPES = YES; 214 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 215 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | CODE_SIGN_IDENTITY = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = dwarf; 221 | ENABLE_STRICT_OBJC_MSGSEND = YES; 222 | ENABLE_TESTABILITY = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu11; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_NO_COMMON_BLOCKS = YES; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = ( 228 | "DEBUG=1", 229 | "$(inherited)", 230 | ); 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 238 | MTL_ENABLE_DEBUG_INFO = YES; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | }; 242 | name = Debug; 243 | }; 244 | 55BABC9420A2CB75005320D5 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_ANALYZER_NONNULL = YES; 249 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_ENABLE_OBJC_WEAK = YES; 255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 256 | CLANG_WARN_BOOL_CONVERSION = YES; 257 | CLANG_WARN_COMMA = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 261 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 268 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 269 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 270 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 271 | CLANG_WARN_STRICT_PROTOTYPES = YES; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 274 | CLANG_WARN_UNREACHABLE_CODE = YES; 275 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 276 | CODE_SIGN_IDENTITY = "iPhone Developer"; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_NS_ASSERTIONS = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu11; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 285 | GCC_WARN_UNDECLARED_SELECTOR = YES; 286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 287 | GCC_WARN_UNUSED_FUNCTION = YES; 288 | GCC_WARN_UNUSED_VARIABLE = YES; 289 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 290 | MTL_ENABLE_DEBUG_INFO = NO; 291 | SDKROOT = iphoneos; 292 | VALIDATE_PRODUCT = YES; 293 | }; 294 | name = Release; 295 | }; 296 | 55BABC9620A2CB75005320D5 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 300 | CODE_SIGN_STYLE = Automatic; 301 | DEVELOPMENT_TEAM = K999N3JYXU; 302 | INFOPLIST_FILE = CYXAudioProgressViewDemo/Info.plist; 303 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 304 | LD_RUNPATH_SEARCH_PATHS = ( 305 | "$(inherited)", 306 | "@executable_path/Frameworks", 307 | ); 308 | PRODUCT_BUNDLE_IDENTIFIER = model.CYXAudioProgressViewDemo; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | TARGETED_DEVICE_FAMILY = "1,2"; 311 | }; 312 | name = Debug; 313 | }; 314 | 55BABC9720A2CB75005320D5 /* Release */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 318 | CODE_SIGN_STYLE = Automatic; 319 | DEVELOPMENT_TEAM = K999N3JYXU; 320 | INFOPLIST_FILE = CYXAudioProgressViewDemo/Info.plist; 321 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 322 | LD_RUNPATH_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "@executable_path/Frameworks", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = model.CYXAudioProgressViewDemo; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | TARGETED_DEVICE_FAMILY = "1,2"; 329 | }; 330 | name = Release; 331 | }; 332 | /* End XCBuildConfiguration section */ 333 | 334 | /* Begin XCConfigurationList section */ 335 | 55BABC7A20A2CB70005320D5 /* Build configuration list for PBXProject "CYXAudioProgressViewDemo" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 55BABC9320A2CB75005320D5 /* Debug */, 339 | 55BABC9420A2CB75005320D5 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | 55BABC9520A2CB75005320D5 /* Build configuration list for PBXNativeTarget "CYXAudioProgressViewDemo" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | 55BABC9620A2CB75005320D5 /* Debug */, 348 | 55BABC9720A2CB75005320D5 /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | /* End XCConfigurationList section */ 354 | }; 355 | rootObject = 55BABC7720A2CB70005320D5 /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo.xcodeproj/xcuserdata/chaojiwandianshang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CYXAudioProgressViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. 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 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. 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 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/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 | } -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/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 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/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 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/CYXAudioProgressView/CYXAudioProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYXAudioProgressView.h 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CYXAudioProgressView : UIView 12 | //无动画设置 进度 13 | @property (assign, nonatomic) CGFloat persentage; 14 | //有动画设置 进度 0~1 15 | -(void)setAnimationPersentage:(CGFloat)persentage; 16 | /** 17 | 初始化layer 在完成frame赋值后调用一下 18 | */ 19 | -(void)initLayers; 20 | @end 21 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/CYXAudioProgressView/CYXAudioProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYXAudioProgressView.m 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. All rights reserved. 7 | // 8 | 9 | #import "CYXAudioProgressView.h" 10 | /*条条间隙*/ 11 | #define kDrawMargin 4 12 | #define kDrawLineWidth 8 13 | /*差值*/ 14 | #define differenceValue 51 15 | @interface CYXAudioProgressView () 16 | 17 | /*条条 灰色路径*/ 18 | @property (nonatomic,strong) CAShapeLayer *shapeLayer; 19 | /*背景黄色*/ 20 | @property (nonatomic,strong) CAShapeLayer *backColorLayer; 21 | @property (nonatomic,strong) CAShapeLayer *maskLayer; 22 | @end 23 | @implementation CYXAudioProgressView 24 | 25 | -(instancetype)initWithFrame:(CGRect)frame{ 26 | if (self = [super initWithFrame:frame]) { 27 | self.backgroundColor = [UIColor blackColor]; 28 | [self.layer addSublayer:self.shapeLayer]; 29 | [self.layer addSublayer:self.backColorLayer]; 30 | self.persentage = 0.0; 31 | } 32 | return self; 33 | } 34 | #pragma mark ---Layers 35 | /** 36 | 初始化layer 在完成frame赋值后调用一下 37 | */ 38 | -(void)initLayers{ 39 | [self initStrokeLayer]; 40 | [self setBackColorLayer]; 41 | } 42 | /*灰色路径*/ 43 | -(void)initStrokeLayer{ 44 | UIBezierPath *path = [UIBezierPath bezierPath]; 45 | CGFloat maxWidth = self.frame.size.width; 46 | CGFloat drawHeight = self.frame.size.height; 47 | CGFloat x = 0.0; 48 | while (x+kDrawLineWidth<=maxWidth) { 49 | CGFloat random =5+ arc4random()%differenceValue;//差值在1-50 之间取 50 | NSLog(@"%f",random); 51 | [path moveToPoint:CGPointMake(x-kDrawLineWidth/2, random)]; 52 | [path addLineToPoint:CGPointMake(x-kDrawLineWidth/2, drawHeight-random)]; 53 | x+=kDrawLineWidth; 54 | x+=kDrawMargin; 55 | } 56 | self.shapeLayer.path = path.CGPath; 57 | self.backColorLayer.path = path.CGPath; 58 | } 59 | /*设置背景layer*/ 60 | -(void)setBackColorLayer{ 61 | UIBezierPath *path = [UIBezierPath bezierPath]; 62 | [path moveToPoint:CGPointMake(0, self.frame.size.height/2)]; 63 | [path addLineToPoint:CGPointMake(self.frame.size.width, self.frame.size.height/2)]; 64 | self.maskLayer.frame = self.bounds; 65 | self.maskLayer.lineWidth = self.frame.size.width; 66 | self.maskLayer.path= path.CGPath; 67 | self.backColorLayer.mask = self.maskLayer; 68 | } 69 | 70 | -(void)setAnimationPersentage:(CGFloat)persentage{ 71 | CGFloat startPersentage = self.persentage; 72 | [self setPersentage:persentage]; 73 | 74 | CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 75 | pathAnimation.duration = 1; 76 | pathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 77 | pathAnimation.fromValue = [NSNumber numberWithFloat:startPersentage]; 78 | pathAnimation.toValue = [NSNumber numberWithFloat:persentage]; 79 | pathAnimation.autoreverses = NO; 80 | pathAnimation.delegate = self; 81 | [self.maskLayer addAnimation:pathAnimation forKey:@"strokeEndAnimation"]; 82 | } 83 | /** 84 | * 在修改百分比的时候,修改彩色遮罩的大小 85 | * 86 | * @param persentage 百分比 87 | */ 88 | - (void)setPersentage:(CGFloat)persentage { 89 | 90 | _persentage = persentage; 91 | self.maskLayer.strokeEnd = persentage; 92 | } 93 | #pragma mark ---G 94 | -(CAShapeLayer*)shapeLayer{ 95 | if(!_shapeLayer){ 96 | _shapeLayer = [[CAShapeLayer alloc] init]; 97 | _shapeLayer.lineWidth = kDrawLineWidth; 98 | _shapeLayer.fillColor = [UIColor clearColor].CGColor; // 填充色为透明(不设置为黑色) 99 | _shapeLayer.lineCap = kCALineCapRound; // 设置线为圆角 100 | _shapeLayer.strokeColor = [UIColor grayColor].CGColor; // 路径颜色颜色 101 | } 102 | return _shapeLayer; 103 | } 104 | -(CAShapeLayer*)backColorLayer{ 105 | if(!_backColorLayer){ 106 | _backColorLayer = [[CAShapeLayer alloc] init]; 107 | _backColorLayer.lineWidth = kDrawLineWidth; 108 | _backColorLayer.fillColor = [UIColor clearColor].CGColor; // 填充色为透明(不设置为黑色) 109 | _backColorLayer.lineCap = kCALineCapRound; // 设置线为圆角 110 | _backColorLayer.strokeColor = [UIColor yellowColor].CGColor; // 路径颜色颜色 111 | } 112 | return _backColorLayer; 113 | } 114 | -(CAShapeLayer*)maskLayer{ 115 | if(!_maskLayer){ 116 | _maskLayer = [[CAShapeLayer alloc] init]; 117 | _maskLayer.strokeColor = [UIColor yellowColor].CGColor; // 路径颜色颜色 118 | } 119 | return _maskLayer; 120 | } 121 | @end 122 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/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 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CYXAudioProgressView.h" 11 | @interface ViewController () 12 | @property (nonatomic,strong) UISlider *slider; 13 | @property (nonatomic,strong) CYXAudioProgressView *loopProgressView; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | self.view.backgroundColor = [UIColor whiteColor]; 22 | 23 | self.loopProgressView.frame =CGRectMake(0, 100, self.view.frame.size.width, 150); 24 | [self.loopProgressView initLayers]; 25 | [self.view addSubview:self.loopProgressView]; 26 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 27 | [self.loopProgressView setAnimationPersentage:0.5]; 28 | }); 29 | 30 | self.slider.frame = CGRectMake(30, self.view.frame.size.height-60, self.view.frame.size.width-30*2, 20); 31 | [self.view addSubview:self.slider]; 32 | } 33 | #pragma mark Actions 34 | -(void)sliderValueChanged:(UISlider *)slider{ 35 | self.loopProgressView.persentage = slider.value; 36 | } 37 | 38 | #pragma mark ---G 39 | -(CYXAudioProgressView*)loopProgressView{ 40 | if(!_loopProgressView){ 41 | _loopProgressView = [[CYXAudioProgressView alloc] init]; 42 | 43 | } 44 | return _loopProgressView; 45 | } 46 | -(UISlider*)slider{ 47 | if(!_slider){ 48 | _slider = [[UISlider alloc] init]; 49 | _slider.tintColor = [UIColor blueColor]; 50 | _slider.value = 0.5; 51 | [_slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged]; 52 | } 53 | return _slider; 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /CYXAudioProgressViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CYXAudioProgressViewDemo 4 | // 5 | // Created by 超级腕电商 on 2018/5/9. 6 | // Copyright © 2018年 超级腕电商. 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 | -------------------------------------------------------------------------------- /QQ20180509-160255-HD.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SionChen/CYXAudioProgressView/bb664df11693d29ca378d98fca40e0e607524921/QQ20180509-160255-HD.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CYXAudioProgressView 2 | 音频进度条 3 |
4 | ![img](https://github.com/SionChen/CYXAudioProgressView/blob/master/QQ20180509-160255-HD.gif) 5 | --------------------------------------------------------------------------------