├── README.md ├── Recording Animation Layer.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── dotsquares.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Recording Animation Layer.xcscheme │ └── xcschememanagement.plist ├── Recording Animation Layer ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── boom.imageset │ │ ├── Contents.json │ │ ├── boom@2x.png │ │ └── boom@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── RecordingButton.swift ├── Recording_Animation_Layer.xcdatamodeld │ ├── .xccurrentversion │ └── Recording_Animation_Layer.xcdatamodel │ │ └── contents └── ViewController.swift ├── Recording Animation LayerTests ├── Info.plist └── Recording_Animation_LayerTests.swift ├── Recording Animation LayerUITests ├── Info.plist └── Recording_Animation_LayerUITests.swift ├── shot_1.png └── shot_2.png /README.md: -------------------------------------------------------------------------------- 1 | # WSVideoRecordButton 2 | This is a animatable video record button, easy to integrate 3 | Simply set the custom class to your button and use. 4 | ![Alt text](https://github.com/WebsoftProfession/WSVideoRecordButton/blob/master/shot_2.png?raw=true "Optional Title") 5 | ![Alt text](https://github.com/WebsoftProfession/WSVideoRecordButton/blob/master/shot_1.png?raw=true "Optional Title") 6 | 7 | -------------------------------------------------------------------------------- /Recording Animation Layer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 606DDC5E1E3F37B6007E61BF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC5D1E3F37B6007E61BF /* AppDelegate.swift */; }; 11 | 606DDC601E3F37B6007E61BF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC5F1E3F37B6007E61BF /* ViewController.swift */; }; 12 | 606DDC631E3F37B6007E61BF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 606DDC611E3F37B6007E61BF /* Main.storyboard */; }; 13 | 606DDC661E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC641E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodeld */; }; 14 | 606DDC681E3F37B7007E61BF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 606DDC671E3F37B7007E61BF /* Assets.xcassets */; }; 15 | 606DDC6B1E3F37B7007E61BF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 606DDC691E3F37B7007E61BF /* LaunchScreen.storyboard */; }; 16 | 606DDC761E3F37B7007E61BF /* Recording_Animation_LayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC751E3F37B7007E61BF /* Recording_Animation_LayerTests.swift */; }; 17 | 606DDC811E3F37B7007E61BF /* Recording_Animation_LayerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC801E3F37B7007E61BF /* Recording_Animation_LayerUITests.swift */; }; 18 | 606DDC911E3F6701007E61BF /* RecordingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606DDC901E3F6701007E61BF /* RecordingButton.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 606DDC721E3F37B7007E61BF /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 606DDC521E3F37B6007E61BF /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 606DDC591E3F37B6007E61BF; 27 | remoteInfo = "Recording Animation Layer"; 28 | }; 29 | 606DDC7D1E3F37B7007E61BF /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 606DDC521E3F37B6007E61BF /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 606DDC591E3F37B6007E61BF; 34 | remoteInfo = "Recording Animation Layer"; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 606DDC5A1E3F37B6007E61BF /* Recording Animation Layer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Recording Animation Layer.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 606DDC5D1E3F37B6007E61BF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 606DDC5F1E3F37B6007E61BF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 42 | 606DDC621E3F37B6007E61BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 606DDC651E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Recording_Animation_Layer.xcdatamodel; sourceTree = ""; }; 44 | 606DDC671E3F37B7007E61BF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 606DDC6A1E3F37B7007E61BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 606DDC6C1E3F37B7007E61BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 606DDC711E3F37B7007E61BF /* Recording Animation LayerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recording Animation LayerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 606DDC751E3F37B7007E61BF /* Recording_Animation_LayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Recording_Animation_LayerTests.swift; sourceTree = ""; }; 49 | 606DDC771E3F37B7007E61BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 606DDC7C1E3F37B7007E61BF /* Recording Animation LayerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Recording Animation LayerUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 606DDC801E3F37B7007E61BF /* Recording_Animation_LayerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Recording_Animation_LayerUITests.swift; sourceTree = ""; }; 52 | 606DDC821E3F37B7007E61BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 606DDC901E3F6701007E61BF /* RecordingButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecordingButton.swift; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 606DDC571E3F37B6007E61BF /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | 606DDC6E1E3F37B7007E61BF /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 606DDC791E3F37B7007E61BF /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 606DDC511E3F37B6007E61BF = { 82 | isa = PBXGroup; 83 | children = ( 84 | 606DDC5C1E3F37B6007E61BF /* Recording Animation Layer */, 85 | 606DDC741E3F37B7007E61BF /* Recording Animation LayerTests */, 86 | 606DDC7F1E3F37B7007E61BF /* Recording Animation LayerUITests */, 87 | 606DDC5B1E3F37B6007E61BF /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 606DDC5B1E3F37B6007E61BF /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 606DDC5A1E3F37B6007E61BF /* Recording Animation Layer.app */, 95 | 606DDC711E3F37B7007E61BF /* Recording Animation LayerTests.xctest */, 96 | 606DDC7C1E3F37B7007E61BF /* Recording Animation LayerUITests.xctest */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | 606DDC5C1E3F37B6007E61BF /* Recording Animation Layer */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 606DDC5D1E3F37B6007E61BF /* AppDelegate.swift */, 105 | 606DDC5F1E3F37B6007E61BF /* ViewController.swift */, 106 | 606DDC611E3F37B6007E61BF /* Main.storyboard */, 107 | 606DDC671E3F37B7007E61BF /* Assets.xcassets */, 108 | 606DDC691E3F37B7007E61BF /* LaunchScreen.storyboard */, 109 | 606DDC6C1E3F37B7007E61BF /* Info.plist */, 110 | 606DDC641E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodeld */, 111 | 606DDC901E3F6701007E61BF /* RecordingButton.swift */, 112 | ); 113 | path = "Recording Animation Layer"; 114 | sourceTree = ""; 115 | }; 116 | 606DDC741E3F37B7007E61BF /* Recording Animation LayerTests */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 606DDC751E3F37B7007E61BF /* Recording_Animation_LayerTests.swift */, 120 | 606DDC771E3F37B7007E61BF /* Info.plist */, 121 | ); 122 | path = "Recording Animation LayerTests"; 123 | sourceTree = ""; 124 | }; 125 | 606DDC7F1E3F37B7007E61BF /* Recording Animation LayerUITests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 606DDC801E3F37B7007E61BF /* Recording_Animation_LayerUITests.swift */, 129 | 606DDC821E3F37B7007E61BF /* Info.plist */, 130 | ); 131 | path = "Recording Animation LayerUITests"; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 606DDC591E3F37B6007E61BF /* Recording Animation Layer */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 606DDC851E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation Layer" */; 140 | buildPhases = ( 141 | 606DDC561E3F37B6007E61BF /* Sources */, 142 | 606DDC571E3F37B6007E61BF /* Frameworks */, 143 | 606DDC581E3F37B6007E61BF /* Resources */, 144 | ); 145 | buildRules = ( 146 | ); 147 | dependencies = ( 148 | ); 149 | name = "Recording Animation Layer"; 150 | productName = "Recording Animation Layer"; 151 | productReference = 606DDC5A1E3F37B6007E61BF /* Recording Animation Layer.app */; 152 | productType = "com.apple.product-type.application"; 153 | }; 154 | 606DDC701E3F37B7007E61BF /* Recording Animation LayerTests */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 606DDC881E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation LayerTests" */; 157 | buildPhases = ( 158 | 606DDC6D1E3F37B7007E61BF /* Sources */, 159 | 606DDC6E1E3F37B7007E61BF /* Frameworks */, 160 | 606DDC6F1E3F37B7007E61BF /* Resources */, 161 | ); 162 | buildRules = ( 163 | ); 164 | dependencies = ( 165 | 606DDC731E3F37B7007E61BF /* PBXTargetDependency */, 166 | ); 167 | name = "Recording Animation LayerTests"; 168 | productName = "Recording Animation LayerTests"; 169 | productReference = 606DDC711E3F37B7007E61BF /* Recording Animation LayerTests.xctest */; 170 | productType = "com.apple.product-type.bundle.unit-test"; 171 | }; 172 | 606DDC7B1E3F37B7007E61BF /* Recording Animation LayerUITests */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = 606DDC8B1E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation LayerUITests" */; 175 | buildPhases = ( 176 | 606DDC781E3F37B7007E61BF /* Sources */, 177 | 606DDC791E3F37B7007E61BF /* Frameworks */, 178 | 606DDC7A1E3F37B7007E61BF /* Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | 606DDC7E1E3F37B7007E61BF /* PBXTargetDependency */, 184 | ); 185 | name = "Recording Animation LayerUITests"; 186 | productName = "Recording Animation LayerUITests"; 187 | productReference = 606DDC7C1E3F37B7007E61BF /* Recording Animation LayerUITests.xctest */; 188 | productType = "com.apple.product-type.bundle.ui-testing"; 189 | }; 190 | /* End PBXNativeTarget section */ 191 | 192 | /* Begin PBXProject section */ 193 | 606DDC521E3F37B6007E61BF /* Project object */ = { 194 | isa = PBXProject; 195 | attributes = { 196 | LastSwiftUpdateCheck = 0820; 197 | LastUpgradeCheck = 0820; 198 | ORGANIZATIONNAME = WebsoftProfession; 199 | TargetAttributes = { 200 | 606DDC591E3F37B6007E61BF = { 201 | CreatedOnToolsVersion = 8.2.1; 202 | ProvisioningStyle = Automatic; 203 | }; 204 | 606DDC701E3F37B7007E61BF = { 205 | CreatedOnToolsVersion = 8.2.1; 206 | ProvisioningStyle = Automatic; 207 | TestTargetID = 606DDC591E3F37B6007E61BF; 208 | }; 209 | 606DDC7B1E3F37B7007E61BF = { 210 | CreatedOnToolsVersion = 8.2.1; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = 606DDC591E3F37B6007E61BF; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 606DDC551E3F37B6007E61BF /* Build configuration list for PBXProject "Recording Animation Layer" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 606DDC511E3F37B6007E61BF; 225 | productRefGroup = 606DDC5B1E3F37B6007E61BF /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 606DDC591E3F37B6007E61BF /* Recording Animation Layer */, 230 | 606DDC701E3F37B7007E61BF /* Recording Animation LayerTests */, 231 | 606DDC7B1E3F37B7007E61BF /* Recording Animation LayerUITests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 606DDC581E3F37B6007E61BF /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 606DDC6B1E3F37B7007E61BF /* LaunchScreen.storyboard in Resources */, 242 | 606DDC681E3F37B7007E61BF /* Assets.xcassets in Resources */, 243 | 606DDC631E3F37B6007E61BF /* Main.storyboard in Resources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | 606DDC6F1E3F37B7007E61BF /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 606DDC7A1E3F37B7007E61BF /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | 606DDC561E3F37B6007E61BF /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 606DDC911E3F6701007E61BF /* RecordingButton.swift in Sources */, 269 | 606DDC601E3F37B6007E61BF /* ViewController.swift in Sources */, 270 | 606DDC5E1E3F37B6007E61BF /* AppDelegate.swift in Sources */, 271 | 606DDC661E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodeld in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 606DDC6D1E3F37B7007E61BF /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 606DDC761E3F37B7007E61BF /* Recording_Animation_LayerTests.swift in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 606DDC781E3F37B7007E61BF /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 606DDC811E3F37B7007E61BF /* Recording_Animation_LayerUITests.swift in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXSourcesBuildPhase section */ 292 | 293 | /* Begin PBXTargetDependency section */ 294 | 606DDC731E3F37B7007E61BF /* PBXTargetDependency */ = { 295 | isa = PBXTargetDependency; 296 | target = 606DDC591E3F37B6007E61BF /* Recording Animation Layer */; 297 | targetProxy = 606DDC721E3F37B7007E61BF /* PBXContainerItemProxy */; 298 | }; 299 | 606DDC7E1E3F37B7007E61BF /* PBXTargetDependency */ = { 300 | isa = PBXTargetDependency; 301 | target = 606DDC591E3F37B6007E61BF /* Recording Animation Layer */; 302 | targetProxy = 606DDC7D1E3F37B7007E61BF /* PBXContainerItemProxy */; 303 | }; 304 | /* End PBXTargetDependency section */ 305 | 306 | /* Begin PBXVariantGroup section */ 307 | 606DDC611E3F37B6007E61BF /* Main.storyboard */ = { 308 | isa = PBXVariantGroup; 309 | children = ( 310 | 606DDC621E3F37B6007E61BF /* Base */, 311 | ); 312 | name = Main.storyboard; 313 | sourceTree = ""; 314 | }; 315 | 606DDC691E3F37B7007E61BF /* LaunchScreen.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | 606DDC6A1E3F37B7007E61BF /* Base */, 319 | ); 320 | name = LaunchScreen.storyboard; 321 | sourceTree = ""; 322 | }; 323 | /* End PBXVariantGroup section */ 324 | 325 | /* Begin XCBuildConfiguration section */ 326 | 606DDC831E3F37B7007E61BF /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 339 | CLANG_WARN_EMPTY_BODY = YES; 340 | CLANG_WARN_ENUM_CONVERSION = YES; 341 | CLANG_WARN_INFINITE_RECURSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = dwarf; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | ENABLE_TESTABILITY = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_DYNAMIC_NO_PIC = NO; 354 | GCC_NO_COMMON_BLOCKS = YES; 355 | GCC_OPTIMIZATION_LEVEL = 0; 356 | GCC_PREPROCESSOR_DEFINITIONS = ( 357 | "DEBUG=1", 358 | "$(inherited)", 359 | ); 360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 362 | GCC_WARN_UNDECLARED_SELECTOR = YES; 363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 364 | GCC_WARN_UNUSED_FUNCTION = YES; 365 | GCC_WARN_UNUSED_VARIABLE = YES; 366 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 367 | MTL_ENABLE_DEBUG_INFO = YES; 368 | ONLY_ACTIVE_ARCH = YES; 369 | SDKROOT = iphoneos; 370 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 606DDC841E3F37B7007E61BF /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 382 | CLANG_CXX_LIBRARY = "libc++"; 383 | CLANG_ENABLE_MODULES = YES; 384 | CLANG_ENABLE_OBJC_ARC = YES; 385 | CLANG_WARN_BOOL_CONVERSION = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 394 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 395 | CLANG_WARN_UNREACHABLE_CODE = YES; 396 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 397 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 398 | COPY_PHASE_STRIP = NO; 399 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 400 | ENABLE_NS_ASSERTIONS = NO; 401 | ENABLE_STRICT_OBJC_MSGSEND = YES; 402 | GCC_C_LANGUAGE_STANDARD = gnu99; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 406 | GCC_WARN_UNDECLARED_SELECTOR = YES; 407 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 408 | GCC_WARN_UNUSED_FUNCTION = YES; 409 | GCC_WARN_UNUSED_VARIABLE = YES; 410 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 411 | MTL_ENABLE_DEBUG_INFO = NO; 412 | SDKROOT = iphoneos; 413 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 414 | TARGETED_DEVICE_FAMILY = "1,2"; 415 | VALIDATE_PRODUCT = YES; 416 | }; 417 | name = Release; 418 | }; 419 | 606DDC861E3F37B7007E61BF /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 423 | INFOPLIST_FILE = "Recording Animation Layer/Info.plist"; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 425 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-Layer"; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SWIFT_VERSION = 3.0; 428 | }; 429 | name = Debug; 430 | }; 431 | 606DDC871E3F37B7007E61BF /* Release */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 435 | INFOPLIST_FILE = "Recording Animation Layer/Info.plist"; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-Layer"; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_VERSION = 3.0; 440 | }; 441 | name = Release; 442 | }; 443 | 606DDC891E3F37B7007E61BF /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 447 | BUNDLE_LOADER = "$(TEST_HOST)"; 448 | INFOPLIST_FILE = "Recording Animation LayerTests/Info.plist"; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 450 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-LayerTests"; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_VERSION = 3.0; 453 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Recording Animation Layer.app/Recording Animation Layer"; 454 | }; 455 | name = Debug; 456 | }; 457 | 606DDC8A1E3F37B7007E61BF /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 461 | BUNDLE_LOADER = "$(TEST_HOST)"; 462 | INFOPLIST_FILE = "Recording Animation LayerTests/Info.plist"; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-LayerTests"; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_VERSION = 3.0; 467 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Recording Animation Layer.app/Recording Animation Layer"; 468 | }; 469 | name = Release; 470 | }; 471 | 606DDC8C1E3F37B7007E61BF /* Debug */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 475 | INFOPLIST_FILE = "Recording Animation LayerUITests/Info.plist"; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-LayerUITests"; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | SWIFT_VERSION = 3.0; 480 | TEST_TARGET_NAME = "Recording Animation Layer"; 481 | }; 482 | name = Debug; 483 | }; 484 | 606DDC8D1E3F37B7007E61BF /* Release */ = { 485 | isa = XCBuildConfiguration; 486 | buildSettings = { 487 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 488 | INFOPLIST_FILE = "Recording Animation LayerUITests/Info.plist"; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 490 | PRODUCT_BUNDLE_IDENTIFIER = "TD.Recording-Animation-LayerUITests"; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | SWIFT_VERSION = 3.0; 493 | TEST_TARGET_NAME = "Recording Animation Layer"; 494 | }; 495 | name = Release; 496 | }; 497 | /* End XCBuildConfiguration section */ 498 | 499 | /* Begin XCConfigurationList section */ 500 | 606DDC551E3F37B6007E61BF /* Build configuration list for PBXProject "Recording Animation Layer" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 606DDC831E3F37B7007E61BF /* Debug */, 504 | 606DDC841E3F37B7007E61BF /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | 606DDC851E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation Layer" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 606DDC861E3F37B7007E61BF /* Debug */, 513 | 606DDC871E3F37B7007E61BF /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | 606DDC881E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation LayerTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | 606DDC891E3F37B7007E61BF /* Debug */, 522 | 606DDC8A1E3F37B7007E61BF /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | 606DDC8B1E3F37B7007E61BF /* Build configuration list for PBXNativeTarget "Recording Animation LayerUITests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 606DDC8C1E3F37B7007E61BF /* Debug */, 531 | 606DDC8D1E3F37B7007E61BF /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | 538 | /* Begin XCVersionGroup section */ 539 | 606DDC641E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodeld */ = { 540 | isa = XCVersionGroup; 541 | children = ( 542 | 606DDC651E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodel */, 543 | ); 544 | currentVersion = 606DDC651E3F37B6007E61BF /* Recording_Animation_Layer.xcdatamodel */; 545 | path = Recording_Animation_Layer.xcdatamodeld; 546 | sourceTree = ""; 547 | versionGroupType = wrapper.xcdatamodel; 548 | }; 549 | /* End XCVersionGroup section */ 550 | }; 551 | rootObject = 606DDC521E3F37B6007E61BF /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /Recording Animation Layer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Recording Animation Layer.xcodeproj/xcuserdata/dotsquares.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Recording Animation Layer.xcodeproj/xcuserdata/dotsquares.xcuserdatad/xcschemes/Recording Animation Layer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Recording Animation Layer.xcodeproj/xcuserdata/dotsquares.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Recording Animation Layer.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 606DDC591E3F37B6007E61BF 16 | 17 | primary 18 | 19 | 20 | 606DDC701E3F37B7007E61BF 21 | 22 | primary 23 | 24 | 25 | 606DDC7B1E3F37B7007E61BF 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Recording Animation Layer/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Recording Animation Layer 4 | // 5 | // Created by Dotsquares on 1/30/17. 6 | // Copyright © 2017 Dotsquares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CoreData 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(_ application: UIApplication) { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 26 | } 27 | 28 | func applicationDidEnterBackground(_ application: UIApplication) { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | func applicationWillEnterForeground(_ application: UIApplication) { 34 | // 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. 35 | } 36 | 37 | func applicationDidBecomeActive(_ application: UIApplication) { 38 | // 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. 39 | } 40 | 41 | func applicationWillTerminate(_ application: UIApplication) { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | // Saves changes in the application's managed object context before the application terminates. 44 | self.saveContext() 45 | } 46 | 47 | // MARK: - Core Data stack 48 | 49 | lazy var persistentContainer: NSPersistentContainer = { 50 | /* 51 | The persistent container for the application. This implementation 52 | creates and returns a container, having loaded the store for the 53 | application to it. This property is optional since there are legitimate 54 | error conditions that could cause the creation of the store to fail. 55 | */ 56 | let container = NSPersistentContainer(name: "Recording_Animation_Layer") 57 | container.loadPersistentStores(completionHandler: { (storeDescription, error) in 58 | if let error = error as NSError? { 59 | // Replace this implementation with code to handle the error appropriately. 60 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 61 | 62 | /* 63 | Typical reasons for an error here include: 64 | * The parent directory does not exist, cannot be created, or disallows writing. 65 | * The persistent store is not accessible, due to permissions or data protection when the device is locked. 66 | * The device is out of space. 67 | * The store could not be migrated to the current model version. 68 | Check the error message to determine what the actual problem was. 69 | */ 70 | fatalError("Unresolved error \(error), \(error.userInfo)") 71 | } 72 | }) 73 | return container 74 | }() 75 | 76 | // MARK: - Core Data Saving support 77 | 78 | func saveContext () { 79 | let context = persistentContainer.viewContext 80 | if context.hasChanges { 81 | do { 82 | try context.save() 83 | } catch { 84 | // Replace this implementation with code to handle the error appropriately. 85 | // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 86 | let nserror = error as NSError 87 | fatalError("Unresolved error \(nserror), \(nserror.userInfo)") 88 | } 89 | } 90 | } 91 | 92 | 93 | 94 | } 95 | 96 | -------------------------------------------------------------------------------- /Recording Animation Layer/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Recording Animation Layer/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Recording Animation Layer/Assets.xcassets/boom.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "boom@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "boom@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Recording Animation Layer/Assets.xcassets/boom.imageset/boom@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebsoftProfession/WSVideoRecordButton/7708fe57da6d808dae0e10ae47fd836388a2f4dc/Recording Animation Layer/Assets.xcassets/boom.imageset/boom@2x.png -------------------------------------------------------------------------------- /Recording Animation Layer/Assets.xcassets/boom.imageset/boom@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebsoftProfession/WSVideoRecordButton/7708fe57da6d808dae0e10ae47fd836388a2f4dc/Recording Animation Layer/Assets.xcassets/boom.imageset/boom@3x.png -------------------------------------------------------------------------------- /Recording Animation Layer/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Recording Animation Layer/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 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Recording Animation Layer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Recording Animation Layer/RecordingButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RecordingButton.swift 3 | // Recording Animation Layer 4 | // 5 | // Created by Dotsquares on 1/30/17. 6 | // Copyright © 2017 Dotsquares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | protocol RecordingButtonDelegate { 13 | func didStartCapture(); 14 | func didEndCapture(); 15 | } 16 | 17 | class RecordingButton: UIButton { 18 | 19 | /* 20 | // Only override draw() if you perform custom drawing. 21 | // An empty implementation adversely affects performance during animation. 22 | */ 23 | 24 | 25 | // setter properties 26 | var innerCircleRadious: CGFloat = 25; 27 | var outerCircleRadious: CGFloat = 30; 28 | var outlineColor: UIColor = UIColor.white; 29 | var innerCircleColor: UIColor = UIColor.red; 30 | var progessColor: UIColor = UIColor.red; 31 | var isContinue :Bool = false; 32 | var recordingDuration: CGFloat = 5; 33 | var delegate: RecordingButtonDelegate?; 34 | 35 | var isCompleteMode :Bool = false; 36 | 37 | 38 | var isRecordingState: Bool = false; 39 | var innerCirlceFrame: CGRect!; 40 | var innerCircleCornerRadious: CGFloat = 0; 41 | 42 | var isPlayingProgress: Bool = false; 43 | var isStopRecording: Bool = false; 44 | 45 | var startProgressValue: CGFloat = 0; 46 | var endProgressValue: CGFloat = 0; 47 | 48 | 49 | var timer: Timer!; 50 | 51 | 52 | 53 | func setOutlineColor(color: UIColor) { 54 | outlineColor = color; 55 | } 56 | 57 | func setInnerCircleColor(color: UIColor) { 58 | innerCircleColor = color; 59 | } 60 | 61 | func setprogessColor(color: UIColor) { 62 | progessColor = color; 63 | } 64 | 65 | func setoutlineRadious(radious: CGFloat) { 66 | outerCircleRadious = radious; 67 | } 68 | 69 | func setInnerCircleRadious(radious: CGFloat) { 70 | innerCircleRadious = radious; 71 | } 72 | 73 | override func draw(_ rect: CGRect) { 74 | // Drawing code 75 | 76 | let outerCircle = UIBezierPath(); 77 | let startAngle = 0; 78 | let endAngle = M_PI * 2; 79 | outerCircle.addArc(withCenter: CGPoint.init(x: rect.size.width/2, y: rect.size.height/2), radius: outerCircleRadious, startAngle: CGFloat(startAngle), endAngle:CGFloat(endAngle), clockwise: true); 80 | outerCircle.lineWidth=2.0; 81 | outlineColor.set(); 82 | outerCircle.stroke(); 83 | 84 | 85 | let innerCircle = UIBezierPath(); 86 | if isRecordingState { 87 | //let innerCircleRect = innerCircle.bounds; 88 | var newUpdatedFrame = innerCirlceFrame; 89 | if isPlayingProgress { 90 | 91 | let progressCircle = UIBezierPath(); 92 | progressCircle.addArc(withCenter: CGPoint.init(x: rect.size.width/2, y: rect.size.height/2), radius: 30, startAngle: CGFloat(startProgressValue), endAngle:CGFloat(endProgressValue), clockwise: true); 93 | progressCircle.lineWidth=2.0; 94 | progessColor.set(); 95 | progressCircle.stroke(); 96 | 97 | } 98 | else 99 | { 100 | newUpdatedFrame?.origin.x += 1; 101 | newUpdatedFrame?.origin.y += 1; 102 | newUpdatedFrame?.size.width -= 2; 103 | newUpdatedFrame?.size.height -= 2; 104 | } 105 | 106 | let circleToRect = UIBezierPath.init(roundedRect: newUpdatedFrame!, cornerRadius: innerCircleCornerRadious); 107 | innerCircleColor.setFill(); 108 | circleToRect.fill(); 109 | } 110 | else 111 | { 112 | innerCircle.addArc(withCenter: CGPoint.init(x: rect.size.width/2, y: rect.size.height/2), radius: innerCircleRadious, startAngle: CGFloat(startAngle), endAngle:CGFloat(endAngle), clockwise: true); 113 | innerCircleColor.setFill(); 114 | innerCircle.fill(); 115 | innerCirlceFrame = innerCircle.bounds; 116 | innerCircleCornerRadious = innerCirlceFrame.size.width/2; 117 | } 118 | 119 | } 120 | 121 | 122 | func record() { 123 | if !isContinue { 124 | isContinue = true; 125 | timer = Timer.scheduledTimer(timeInterval: 0.05, target: self, selector: #selector(self.playStateChangeAnimation), userInfo: nil, repeats: true); 126 | } 127 | else 128 | { 129 | stopRecord(); 130 | } 131 | } 132 | 133 | func stopRecord() { 134 | delegate?.didEndCapture(); 135 | isContinue = false; 136 | isStopRecording=true; 137 | isPlayingProgress = false; 138 | isRecordingState = false; 139 | endProgressValue=0; 140 | //innerCircleRadious=25; 141 | isCompleteMode = true; 142 | timer.invalidate(); 143 | timer = nil; 144 | timer = Timer.scheduledTimer(timeInterval: 0.05, target: self, selector: #selector(self.restoreDefaultState), userInfo: nil, repeats: true); 145 | 146 | } 147 | 148 | func restoreDefaultState() { 149 | //repeat{ 150 | if innerCircleRadious<25 { 151 | innerCircleRadious += 1; 152 | } 153 | else 154 | { 155 | isCompleteMode = false; 156 | innerCircleCornerRadious -= 1; 157 | } 158 | setNeedsDisplay(); 159 | if innerCircleRadious>=25 { 160 | 161 | timer.invalidate(); 162 | timer = nil; 163 | 164 | } 165 | setNeedsDisplay(); 166 | 167 | } 168 | 169 | func playProgress() { 170 | endProgressValue += (CGFloat(M_PI * 2)/recordingDuration * 0.05); 171 | let endAngle = M_PI * 2; 172 | if endProgressValue > CGFloat(endAngle) { 173 | stopRecord(); 174 | } 175 | setNeedsDisplay(); 176 | } 177 | 178 | func playStateChangeAnimation() { 179 | 180 | 181 | //repeat{ 182 | if innerCircleRadious>15 { 183 | innerCircleRadious -= 1; 184 | } 185 | else 186 | { 187 | isRecordingState = true; 188 | innerCircleCornerRadious -= 1; 189 | } 190 | setNeedsDisplay(); 191 | 192 | //}while innerCircleCornerRadious>0 193 | 194 | if innerCircleCornerRadious<=5 { 195 | timer.invalidate(); 196 | timer=nil; 197 | isRecordingState = true; 198 | isPlayingProgress = true; 199 | 200 | timer = Timer.scheduledTimer(timeInterval: 0.05, target: self, selector: #selector(self.playProgress), userInfo: nil, repeats: true); 201 | delegate?.didStartCapture(); 202 | } 203 | 204 | } 205 | 206 | } 207 | -------------------------------------------------------------------------------- /Recording Animation Layer/Recording_Animation_Layer.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | Recording_Animation_Layer.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /Recording Animation Layer/Recording_Animation_Layer.xcdatamodeld/Recording_Animation_Layer.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Recording Animation Layer/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Recording Animation Layer 4 | // 5 | // Created by Dotsquares on 1/30/17. 6 | // Copyright © 2017 Dotsquares. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | // new functionality to add to SomeType goes here 13 | func rotateView(byAngle: CGFloat) 14 | { 15 | if byAngle == 0 { 16 | UIView.animate(withDuration: 1.0, animations: { 17 | self.transform = CGAffineTransform.identity; 18 | }); 19 | } 20 | else 21 | { 22 | UIView.animate(withDuration: 1.0, animations: { 23 | self.transform = CGAffineTransform.init(rotationAngle: byAngle); 24 | }); 25 | } 26 | } 27 | } 28 | 29 | class ViewController: UIViewController,RecordingButtonDelegate { 30 | 31 | @IBOutlet weak var btnRecord: RecordingButton! 32 | override func viewDidLoad() { 33 | super.viewDidLoad() 34 | // btnRecord.setOutlineColor(color: UIColor.cyan); 35 | // btnRecord.setInnerCircleColor(color: UIColor.cyan); 36 | // btnRecord.setprogessColor(color: UIColor.blue); 37 | btnRecord.recordingDuration = 20; 38 | btnRecord.delegate=self; 39 | // Do any additional setup after loading the view, typically from a nib. 40 | 41 | } 42 | 43 | 44 | @IBAction func btnRecordAction(_ sender: Any) { 45 | btnRecord.record(); 46 | } 47 | 48 | 49 | 50 | override func didReceiveMemoryWarning() { 51 | super.didReceiveMemoryWarning() 52 | // Dispose of any resources that can be recreated. 53 | } 54 | 55 | 56 | // RecordingButtonDelegate Methods 57 | func didStartCapture() { 58 | // call when capturing starts. 59 | } 60 | 61 | func didEndCapture() { 62 | // call when capturing end. 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Recording Animation LayerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Recording Animation LayerTests/Recording_Animation_LayerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Recording_Animation_LayerTests.swift 3 | // Recording Animation LayerTests 4 | // 5 | // Created by Dotsquares on 1/30/17. 6 | // Copyright © 2017 Dotsquares. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Recording_Animation_Layer 11 | 12 | class Recording_Animation_LayerTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Recording Animation LayerUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Recording Animation LayerUITests/Recording_Animation_LayerUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Recording_Animation_LayerUITests.swift 3 | // Recording Animation LayerUITests 4 | // 5 | // Created by Dotsquares on 1/30/17. 6 | // Copyright © 2017 Dotsquares. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class Recording_Animation_LayerUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // 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. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /shot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebsoftProfession/WSVideoRecordButton/7708fe57da6d808dae0e10ae47fd836388a2f4dc/shot_1.png -------------------------------------------------------------------------------- /shot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WebsoftProfession/WSVideoRecordButton/7708fe57da6d808dae0e10ae47fd836388a2f4dc/shot_2.png --------------------------------------------------------------------------------