diff --git a/ACPDownload.podspec b/ACPDownload.podspec deleted file mode 100644 index 528abee..0000000 --- a/ACPDownload.podspec +++ /dev/null @@ -1,17 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'ACPDownload' - s.version = '1.0.0' - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.homepage = 'https://github.com/antoniocasero/ACPDownload' - s.authors = {'Antonio Casero' => 'anto.casero@gmail.com'} - s.summary = 'ACPDownload provides a download indicator with 4 different states, valid for any view size. Easy to customize and configure.' - -# Source Info - s.platform = :ios, '7.1' - s.source = { :git => "https://github.com/antoniocasero/ACPDownload.git", :tag => s.version.to_s } - s.source_files = 'ACPDownload' - s.requires_arc = true - -# Pod Dependencies - -end \ No newline at end of file diff --git a/ACPDownload.xcodeproj/project.pbxproj b/ACPDownload.xcodeproj/project.pbxproj deleted file mode 100644 index 7d534dd..0000000 --- a/ACPDownload.xcodeproj/project.pbxproj +++ /dev/null @@ -1,409 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 458EE6EA1A6C420200FDBE47 /* ExampleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 458EE6E91A6C420200FDBE47 /* ExampleCell.m */; }; - 45BDEDAD1A6DA509004CC7B2 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 45BDEDAC1A6DA509004CC7B2 /* README.md */; }; - 45CBADC31A619C280094E920 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 45CBADC21A619C280094E920 /* main.m */; }; - 45CBADC61A619C280094E920 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 45CBADC51A619C280094E920 /* AppDelegate.m */; }; - 45CBADC91A619C280094E920 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45CBADC81A619C280094E920 /* ViewController.m */; }; - 45CBADCC1A619C280094E920 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 45CBADCA1A619C280094E920 /* Main.storyboard */; }; - 45CBADCE1A619C280094E920 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45CBADCD1A619C280094E920 /* Images.xcassets */; }; - 45CBADD11A619C280094E920 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 45CBADCF1A619C280094E920 /* LaunchScreen.xib */; }; - 45CBADEB1A619FDA0094E920 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45CBADEA1A619FDA0094E920 /* CoreGraphics.framework */; }; - 45D968311A7507AA0060B654 /* ACPDownloadConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D968221A7507AA0060B654 /* ACPDownloadConstants.m */; }; - 45D968321A7507AA0060B654 /* ACPDownloadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D968241A7507AA0060B654 /* ACPDownloadView.m */; }; - 45D968331A7507AA0060B654 /* ACPIndeterminateGoogleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D968261A7507AA0060B654 /* ACPIndeterminateGoogleLayer.m */; }; - 45D968341A7507AA0060B654 /* ACPIndeterminateLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D968281A7507AA0060B654 /* ACPIndeterminateLayer.m */; }; - 45D968351A7507AA0060B654 /* ACPProgressLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D9682B1A7507AA0060B654 /* ACPProgressLayer.m */; }; - 45D968361A7507AA0060B654 /* ACPStaticImages.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D9682D1A7507AA0060B654 /* ACPStaticImages.m */; }; - 45D968371A7507AA0060B654 /* ACPStaticImagesAlternative.m in Sources */ = {isa = PBXBuildFile; fileRef = 45D9682F1A7507AA0060B654 /* ACPStaticImagesAlternative.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 458EE6E81A6C420200FDBE47 /* ExampleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleCell.h; sourceTree = ""; }; - 458EE6E91A6C420200FDBE47 /* ExampleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleCell.m; sourceTree = ""; }; - 45BDEDAC1A6DA509004CC7B2 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - 45CBADBD1A619C280094E920 /* ACPDownload.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ACPDownload.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 45CBADC11A619C280094E920 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 45CBADC21A619C280094E920 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 45CBADC41A619C280094E920 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 45CBADC51A619C280094E920 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 45CBADC71A619C280094E920 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 45CBADC81A619C280094E920 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 45CBADCB1A619C280094E920 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 45CBADCD1A619C280094E920 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 45CBADD01A619C280094E920 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 45CBADEA1A619FDA0094E920 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 45D968211A7507AA0060B654 /* ACPDownloadConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPDownloadConstants.h; sourceTree = ""; }; - 45D968221A7507AA0060B654 /* ACPDownloadConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPDownloadConstants.m; sourceTree = ""; }; - 45D968231A7507AA0060B654 /* ACPDownloadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPDownloadView.h; sourceTree = ""; }; - 45D968241A7507AA0060B654 /* ACPDownloadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPDownloadView.m; sourceTree = ""; }; - 45D968251A7507AA0060B654 /* ACPIndeterminateGoogleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPIndeterminateGoogleLayer.h; sourceTree = ""; }; - 45D968261A7507AA0060B654 /* ACPIndeterminateGoogleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPIndeterminateGoogleLayer.m; sourceTree = ""; }; - 45D968271A7507AA0060B654 /* ACPIndeterminateLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPIndeterminateLayer.h; sourceTree = ""; }; - 45D968281A7507AA0060B654 /* ACPIndeterminateLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPIndeterminateLayer.m; sourceTree = ""; }; - 45D968291A7507AA0060B654 /* ACPLayerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPLayerProtocol.h; sourceTree = ""; }; - 45D9682A1A7507AA0060B654 /* ACPProgressLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPProgressLayer.h; sourceTree = ""; }; - 45D9682B1A7507AA0060B654 /* ACPProgressLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPProgressLayer.m; sourceTree = ""; }; - 45D9682C1A7507AA0060B654 /* ACPStaticImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPStaticImages.h; sourceTree = ""; }; - 45D9682D1A7507AA0060B654 /* ACPStaticImages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPStaticImages.m; sourceTree = ""; }; - 45D9682E1A7507AA0060B654 /* ACPStaticImagesAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPStaticImagesAlternative.h; sourceTree = ""; }; - 45D9682F1A7507AA0060B654 /* ACPStaticImagesAlternative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ACPStaticImagesAlternative.m; sourceTree = ""; }; - 45D968301A7507AA0060B654 /* ACPStaticImagesProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACPStaticImagesProtocol.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 45CBADBA1A619C280094E920 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 45CBADEB1A619FDA0094E920 /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 458EE6E41A6C41CF00FDBE47 /* Example */ = { - isa = PBXGroup; - children = ( - 45CBADC41A619C280094E920 /* AppDelegate.h */, - 45CBADC51A619C280094E920 /* AppDelegate.m */, - 45CBADC71A619C280094E920 /* ViewController.h */, - 45CBADC81A619C280094E920 /* ViewController.m */, - 45CBADCA1A619C280094E920 /* Main.storyboard */, - 458EE6E81A6C420200FDBE47 /* ExampleCell.h */, - 458EE6E91A6C420200FDBE47 /* ExampleCell.m */, - ); - name = Example; - sourceTree = ""; - }; - 45CBADB41A619C280094E920 = { - isa = PBXGroup; - children = ( - 45BDEDAC1A6DA509004CC7B2 /* README.md */, - 45CBADBF1A619C280094E920 /* Example */, - 45CBADBE1A619C280094E920 /* Products */, - 45CBADEA1A619FDA0094E920 /* CoreGraphics.framework */, - ); - sourceTree = ""; - }; - 45CBADBE1A619C280094E920 /* Products */ = { - isa = PBXGroup; - children = ( - 45CBADBD1A619C280094E920 /* ACPDownload.app */, - ); - name = Products; - sourceTree = ""; - }; - 45CBADBF1A619C280094E920 /* Example */ = { - isa = PBXGroup; - children = ( - 45D968201A7507AA0060B654 /* ACPDownload */, - 458EE6E41A6C41CF00FDBE47 /* Example */, - 45CBADCD1A619C280094E920 /* Images.xcassets */, - 45CBADCF1A619C280094E920 /* LaunchScreen.xib */, - 45CBADC01A619C280094E920 /* Supporting Files */, - ); - path = Example; - sourceTree = ""; - }; - 45CBADC01A619C280094E920 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 45CBADC11A619C280094E920 /* Info.plist */, - 45CBADC21A619C280094E920 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 45D968201A7507AA0060B654 /* ACPDownload */ = { - isa = PBXGroup; - children = ( - 45D9689E1A7551E10060B654 /* Images */, - 45D9689D1A7551CF0060B654 /* Animations */, - 45D9689C1A7551BE0060B654 /* Protocols */, - 45D968211A7507AA0060B654 /* ACPDownloadConstants.h */, - 45D968221A7507AA0060B654 /* ACPDownloadConstants.m */, - 45D968231A7507AA0060B654 /* ACPDownloadView.h */, - 45D968241A7507AA0060B654 /* ACPDownloadView.m */, - ); - path = ACPDownload; - sourceTree = SOURCE_ROOT; - }; - 45D9689C1A7551BE0060B654 /* Protocols */ = { - isa = PBXGroup; - children = ( - 45D968291A7507AA0060B654 /* ACPLayerProtocol.h */, - 45D968301A7507AA0060B654 /* ACPStaticImagesProtocol.h */, - ); - name = Protocols; - sourceTree = ""; - }; - 45D9689D1A7551CF0060B654 /* Animations */ = { - isa = PBXGroup; - children = ( - 45D968251A7507AA0060B654 /* ACPIndeterminateGoogleLayer.h */, - 45D968261A7507AA0060B654 /* ACPIndeterminateGoogleLayer.m */, - 45D968271A7507AA0060B654 /* ACPIndeterminateLayer.h */, - 45D968281A7507AA0060B654 /* ACPIndeterminateLayer.m */, - 45D9682A1A7507AA0060B654 /* ACPProgressLayer.h */, - 45D9682B1A7507AA0060B654 /* ACPProgressLayer.m */, - ); - name = Animations; - sourceTree = ""; - }; - 45D9689E1A7551E10060B654 /* Images */ = { - isa = PBXGroup; - children = ( - 45D9682C1A7507AA0060B654 /* ACPStaticImages.h */, - 45D9682D1A7507AA0060B654 /* ACPStaticImages.m */, - 45D9682E1A7507AA0060B654 /* ACPStaticImagesAlternative.h */, - 45D9682F1A7507AA0060B654 /* ACPStaticImagesAlternative.m */, - ); - name = Images; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 45CBADBC1A619C280094E920 /* ACPDownload */ = { - isa = PBXNativeTarget; - buildConfigurationList = 45CBADE01A619C290094E920 /* Build configuration list for PBXNativeTarget "ACPDownload" */; - buildPhases = ( - 45CBADB91A619C280094E920 /* Sources */, - 45CBADBA1A619C280094E920 /* Frameworks */, - 45CBADBB1A619C280094E920 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ACPDownload; - productName = ACPDownload; - productReference = 45CBADBD1A619C280094E920 /* ACPDownload.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 45CBADB51A619C280094E920 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = "Antonio Casero Palmero"; - TargetAttributes = { - 45CBADBC1A619C280094E920 = { - CreatedOnToolsVersion = 6.1.1; - DevelopmentTeam = 9HX8L3BY3M; - }; - }; - }; - buildConfigurationList = 45CBADB81A619C280094E920 /* Build configuration list for PBXProject "ACPDownload" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 45CBADB41A619C280094E920; - productRefGroup = 45CBADBE1A619C280094E920 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 45CBADBC1A619C280094E920 /* ACPDownload */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 45CBADBB1A619C280094E920 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 45CBADCC1A619C280094E920 /* Main.storyboard in Resources */, - 45CBADD11A619C280094E920 /* LaunchScreen.xib in Resources */, - 45CBADCE1A619C280094E920 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 45CBADB91A619C280094E920 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 45D968371A7507AA0060B654 /* ACPStaticImagesAlternative.m in Sources */, - 45D968341A7507AA0060B654 /* ACPIndeterminateLayer.m in Sources */, - 45D968351A7507AA0060B654 /* ACPProgressLayer.m in Sources */, - 45D968321A7507AA0060B654 /* ACPDownloadView.m in Sources */, - 45D968361A7507AA0060B654 /* ACPStaticImages.m in Sources */, - 458EE6EA1A6C420200FDBE47 /* ExampleCell.m in Sources */, - 45CBADC91A619C280094E920 /* ViewController.m in Sources */, - 45CBADC61A619C280094E920 /* AppDelegate.m in Sources */, - 45BDEDAD1A6DA509004CC7B2 /* README.md in Sources */, - 45D968311A7507AA0060B654 /* ACPDownloadConstants.m in Sources */, - 45CBADC31A619C280094E920 /* main.m in Sources */, - 45D968331A7507AA0060B654 /* ACPIndeterminateGoogleLayer.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 45CBADCA1A619C280094E920 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 45CBADCB1A619C280094E920 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 45CBADCF1A619C280094E920 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 45CBADD01A619C280094E920 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 45CBADDE1A619C290094E920 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 45CBADDF1A619C290094E920 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 45CBADE11A619C290094E920 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - INFOPLIST_FILE = Example/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - }; - name = Debug; - }; - 45CBADE21A619C290094E920 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - INFOPLIST_FILE = Example/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 45CBADB81A619C280094E920 /* Build configuration list for PBXProject "ACPDownload" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 45CBADDE1A619C290094E920 /* Debug */, - 45CBADDF1A619C290094E920 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 45CBADE01A619C290094E920 /* Build configuration list for PBXNativeTarget "ACPDownload" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 45CBADE11A619C290094E920 /* Debug */, - 45CBADE21A619C290094E920 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 45CBADB51A619C280094E920 /* Project object */; -} diff --git a/ACPDownload/ACPDownloadConstants.h b/ACPDownload/ACPDownloadConstants.h deleted file mode 100644 index e931a63..0000000 --- a/ACPDownload/ACPDownloadConstants.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// ACPDownloadConstants.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import - -@interface ACPDownloadConstants : NSObject - -extern NSString *const kACPStrokeAnimationKey; -extern NSString *const kACPRotationAnimationKey; - -typedef NS_ENUM(NSUInteger, ACPDownloadStatus) { - ACPDownloadStatusNone, - ACPDownloadStatusRunning, - ACPDownloadStatusIndeterminate, - ACPDownloadStatusCompleted, - -}; - -@end diff --git a/ACPDownload/ACPDownloadConstants.m b/ACPDownload/ACPDownloadConstants.m deleted file mode 100644 index 800fc3e..0000000 --- a/ACPDownload/ACPDownloadConstants.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// ACPDownloadConstants.m -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPDownloadConstants.h" - -@implementation ACPDownloadConstants - -NSString *const kACPStrokeAnimationKey = @"com.acpdownload.animation.stroke"; -NSString *const kACPRotationAnimationKey = @"com.acpdownload.animation.rotation"; - -@end diff --git a/ACPDownload/ACPDownloadView.h b/ACPDownload/ACPDownloadView.h deleted file mode 100644 index a6f96c0..0000000 --- a/ACPDownload/ACPDownloadView.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// ACPDownloadView.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPLayerProtocol.h" -#import "ACPStaticImagesProtocol.h" -#import "ACPDownloadConstants.h" - -@class ACPDownloadView; - -typedef void (^ACPViewTappedBlock)(ACPDownloadView * downloadView, ACPDownloadStatus status); - -/** - `ACPDownloadView` - - ##Purpose - Custom view. Provides a graphic representation of 4 different states. - *ACPDownloadStatusNone -> Initial state, nothing has been downloaded. - *ACPDownloadStatusRunning -> The download or process is in progress. - *ACPDownloadStatusIndeterminate -> Indeterminate state. (waiting, installing,...) - *ACPDownloadStatusCompleted -> Final state, the process is completed. - - - @see ACPDownloadConstants; - */ -@interface ACPDownloadView : UIView - -@property (nonatomic, readonly, assign) ACPDownloadStatus currentStatus; - -/** - * This method defines the state of the download indicator. - * - * @param newStatus current state of your process - */ -- (void)setIndicatorStatus:(ACPDownloadStatus)newStatus; - -/** - * Defines the progression of your process. - * @warning you can set the value when you want. But if the view state is not ACPDownloadStatusRunning you won't see - * the graphical representation. - - * @param progress Float value - from 0 to 1 - * @param animated Animation flag. - */ -- (void)setProgress:(float)progress animated:(BOOL)animated; - -/** - * Defines the behaviour when the user tap over it. - * The implementation is optional. - * - * @param blockAction The block input provides the view object and the current state. - */ -- (void)setActionForTap:(ACPViewTappedBlock)blockAction; - -/** - * Define a new indeterminate layer, replacing the default one. - * @see ACPLayerProtocol, ACPIndeterminateLayer - * @param layer Object who conforms the protocol ACPLayerProtocol. - */ -- (void)setIndeterminateLayer:(id)layer; - -/** - * Define a new progress layer, replacing the default one. - * @see ACPLayerProtocol, ACPProgressLater - * @param layer Object who conforms the protocol ACPLayerProtocol. - */ -- (void)setProgressLayer:(id)layer; - -/** - * Define a new set of images, replacing the default one. - * @see ACPStaticImagesProtocol - * @param layer Object who conforms the protocol ACPStaticImagesProtocol. - */ -- (void)setImages:(id)images; -@end diff --git a/ACPDownload/ACPDownloadView.m b/ACPDownload/ACPDownloadView.m deleted file mode 100644 index b31bdab..0000000 --- a/ACPDownload/ACPDownloadView.m +++ /dev/null @@ -1,181 +0,0 @@ - // -// ACPDownloadView.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPDownloadView.h" -#import "ACPIndeterminateLayer.h" -#import "ACPProgressLayer.h" -#import "ACPStaticImages.h" - - -@interface ACPDownloadView() - -@property (nonatomic, readwrite, assign) ACPDownloadStatus currentStatus; -@property (nonatomic, copy) ACPViewTappedBlock viewTappedBlock; -@property (nonatomic, strong) id staticImages; -@property (nonatomic, strong) id indeterminateShapelayer; -@property (nonatomic, strong) id progressShapelayer; - - -@end - -@implementation ACPDownloadView - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self initialize]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - [self initialize]; - } - return self; -} - -- (void)initialize { - - [self setIndicatorStatus:ACPDownloadStatusNone]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resetAnimations) name:UIApplicationDidBecomeActiveNotification object:nil]; - - UITapGestureRecognizer *singleFingerTap = - [[UITapGestureRecognizer alloc] initWithTarget:self - action:@selector(handleSingleTap:)]; - [self addGestureRecognizer:singleFingerTap]; - -} -- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer { - NSLog(@"Tap recieved"); - if(self.viewTappedBlock){ - self.viewTappedBlock(self, self.currentStatus); - } -} -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; -} -- (void)layoutSubviews { - //We set the bounds - [super layoutSubviews]; - if(!self.staticImages){ - self.staticImages = [ACPStaticImages new]; - [self.staticImages updateColor:self.tintColor]; - } - - [self.staticImages updateFrame:self.bounds]; - -} - -- (void)setIndicatorStatus:(ACPDownloadStatus)newStatus { - self.currentStatus = newStatus; - [self setNeedsDisplay]; -} - -- (void)resetAnimations { - - if (self.indeterminateLayer.isAnimating) { - [self.indeterminateLayer stopAnimating]; - [self.indeterminateLayer startAnimating]; - } -} - -- (void)setProgress:(float)progress animated:(BOOL)animated { - [self.progressShapelayer setProgress:progress animated:animated]; - -} -- (void)drawRect:(CGRect)rect { - - [self.indeterminateShapelayer removeLayer]; - [self.progressShapelayer removeLayer]; - switch (self.currentStatus) { - case ACPDownloadStatusNone:{ - [self.staticImages drawStatusNone]; - break; - } - case ACPDownloadStatusRunning:{ - - [self initializeProgress]; - [self.staticImages drawStatusRunning]; - break; - } - case ACPDownloadStatusIndeterminate:{ - - [self initializeIndeterminate]; - [self.indeterminateLayer startAnimating]; - [self.staticImages drawStatusIndeterminate]; - //Nothing - break; - } - case ACPDownloadStatusCompleted:{ - [self.staticImages drawStatusComplete]; - break; - } - default: - break; - } - [self setNeedsDisplay]; - -} - -- (id)progressShapelayer { - if (!_progressShapelayer) { - _progressShapelayer = [ACPProgressLayer new]; - } - return _progressShapelayer; -} -- (id)indeterminateLayer { - - if (!_indeterminateShapelayer) { - _indeterminateShapelayer = [ACPIndeterminateLayer new]; - } - return _indeterminateShapelayer; -} - -- (void)tintColorDidChange { - [super tintColorDidChange]; - [self.indeterminateLayer updateColor:self.tintColor]; - [self.progressShapelayer updateColor:self.tintColor]; - [self.staticImages updateColor:self.tintColor]; -} - - - -- (void)setActionForTap:(ACPViewTappedBlock)blockAction { - self.viewTappedBlock = blockAction; -} - -- (void)setIndeterminateLayer:(id)layer { - [layer updateFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; - _indeterminateShapelayer = layer; - -} -- (void)setProgressLayer:(id)layer { - [layer updateFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; - _progressShapelayer = layer; - -} - -- (void)initializeIndeterminate { - [self.indeterminateLayer updateColor:self.tintColor]; - [self.layer addSublayer:self.indeterminateLayer.layer]; - [self.indeterminateShapelayer updateFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; -} - -- (void)initializeProgress{ - [self.progressShapelayer updateColor:self.tintColor]; - [self.layer addSublayer:self.progressShapelayer.layer]; - [self.progressShapelayer updateFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; -} - -- (void)setImages:(id)images{ - self.staticImages = images; - [self.staticImages updateFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))]; -} -@end diff --git a/ACPDownload/ACPIndeterminateGoogleLayer.h b/ACPDownload/ACPIndeterminateGoogleLayer.h deleted file mode 100644 index fc8a566..0000000 --- a/ACPDownload/ACPIndeterminateGoogleLayer.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// ACPIndeterminateGoogleLayer.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPLayerProtocol.h" - -@interface ACPIndeterminateGoogleLayer : NSObject - -@end diff --git a/ACPDownload/ACPIndeterminateGoogleLayer.m b/ACPDownload/ACPIndeterminateGoogleLayer.m deleted file mode 100644 index e45de80..0000000 --- a/ACPDownload/ACPIndeterminateGoogleLayer.m +++ /dev/null @@ -1,128 +0,0 @@ -// -// ACPIndeterminateGoogleLayer.m -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPIndeterminateGoogleLayer.h" -#import "ACPDownloadConstants.h" - -@interface ACPIndeterminateGoogleLayer() - -@property (nonatomic, readwrite) CAShapeLayer * layer; -@property (nonatomic, readwrite) UIColor * colorLayer; -@property (nonatomic, assign) CGRect frame; -@property (nonatomic, assign, readwrite, getter= isAnimating) BOOL animate; - -@end - -@implementation ACPIndeterminateGoogleLayer - - - -- (CAShapeLayer *) layer { - if (!_layer) { - _layer = [CAShapeLayer layer]; - _layer.strokeColor = self.colorLayer.CGColor; - _layer.fillColor = nil; - _layer.lineWidth = 1.5f; - } - return _layer; -} - -- (void)updateFrame:(CGRect)frame { - self.frame = frame; - self.layer.frame = frame; - [self updatePath]; - -} - -- (void)updatePath { - - CGPoint center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); - CGFloat radius = MIN(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) - self.layer.lineWidth / 2; - CGFloat startAngle = (CGFloat)(-M_PI_4); - CGFloat endAngle = (CGFloat)(3 * M_PI_2); - UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - self.layer.path = path.CGPath; - -} - -#pragma mark - - -- (void)startAnimating{ - - CAMediaTimingFunction * timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - CABasicAnimation *animation = [CABasicAnimation animation]; - animation.keyPath = @"transform.rotation"; - animation.duration = 4.f; - animation.fromValue = @(0.f); - animation.toValue = @(2 * M_PI); - animation.repeatCount = INFINITY; - [self.layer addAnimation:animation forKey:kACPRotationAnimationKey]; - - CABasicAnimation *headAnimation = [CABasicAnimation animation]; - headAnimation.keyPath = @"strokeStart"; - headAnimation.duration = 1.f; - headAnimation.fromValue = @(0.f); - headAnimation.toValue = @(0.25f); - headAnimation.timingFunction = timingFunction; - - CABasicAnimation *tailAnimation = [CABasicAnimation animation]; - tailAnimation.keyPath = @"strokeEnd"; - tailAnimation.duration = 1.f; - tailAnimation.fromValue = @(0.f); - tailAnimation.toValue = @(1.f); - tailAnimation.timingFunction = timingFunction; - - - CABasicAnimation *endHeadAnimation = [CABasicAnimation animation]; - endHeadAnimation.keyPath = @"strokeStart"; - endHeadAnimation.beginTime = 1.f; - endHeadAnimation.duration = 0.5f; - endHeadAnimation.fromValue = @(0.25f); - endHeadAnimation.toValue = @(1.f); - endHeadAnimation.timingFunction = timingFunction; - - CABasicAnimation *endTailAnimation = [CABasicAnimation animation]; - endTailAnimation.keyPath = @"strokeEnd"; - endTailAnimation.beginTime = 1.f; - endTailAnimation.duration = 0.5f; - endTailAnimation.fromValue = @(1.f); - endTailAnimation.toValue = @(1.f); - endTailAnimation.timingFunction = timingFunction; - - CAAnimationGroup *animations = [CAAnimationGroup animation]; - [animations setDuration:1.5f]; - [animations setAnimations:@[headAnimation, tailAnimation, endHeadAnimation, endTailAnimation]]; - animations.repeatCount = INFINITY; - [self.layer addAnimation:animations forKey:kACPStrokeAnimationKey]; - self.animate = YES; - -} -- (void)stopAnimating{ - - if (!self.isAnimating) - return; - - [self.layer removeAnimationForKey:kACPRotationAnimationKey]; - [self.layer removeAnimationForKey:kACPStrokeAnimationKey]; - self.animate = NO; - -} - -- (void)updateColor:(UIColor*)color { - self.layer.strokeColor = color.CGColor; -} - -- (void)setHidden:(BOOL)hidden { - self.layer.hidden = YES; - -} -- (void)removeLayer { - [self stopAnimating]; - [self.layer removeFromSuperlayer]; -} -@end diff --git a/ACPDownload/ACPIndeterminateLayer.h b/ACPDownload/ACPIndeterminateLayer.h deleted file mode 100644 index 08f3424..0000000 --- a/ACPDownload/ACPIndeterminateLayer.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// ACPIndeterminateLayer.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPLayerProtocol.h" - -@interface ACPIndeterminateLayer : NSObject - - - -@end diff --git a/ACPDownload/ACPIndeterminateLayer.m b/ACPDownload/ACPIndeterminateLayer.m deleted file mode 100644 index 346d124..0000000 --- a/ACPDownload/ACPIndeterminateLayer.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// ACPIndeterminateLayer.m -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPIndeterminateLayer.h" -#import "ACPDownloadConstants.h" - -@interface ACPIndeterminateLayer() - -@property (nonatomic, readwrite) CAShapeLayer * layer; -@property (nonatomic, readwrite) UIColor * colorLayer; -@property (nonatomic, assign) CGRect frame; -@property (nonatomic, assign, readwrite, getter= isAnimating) BOOL animate; - -@end - -@implementation ACPIndeterminateLayer - - - -- (CAShapeLayer *) layer { - if (!_layer) { - _layer = [CAShapeLayer layer]; - _layer.strokeColor = self.colorLayer.CGColor; - _layer.fillColor = nil; - _layer.lineWidth = 1.5f; - } - return _layer; -} - -- (void)updateFrame:(CGRect)frame { - self.frame = frame; - self.layer.frame = frame; - [self updatePath]; - -} - -- (void)updatePath { - - CGPoint center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); - CGFloat radius = MIN(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) - self.layer.lineWidth / 2; - CGFloat startAngle = (CGFloat)(-M_PI_4); - CGFloat endAngle = (CGFloat)(3 * M_PI_2); - UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - self.layer.path = path.CGPath; - -} - -#pragma mark - - -- (void)startAnimating{ - - CABasicAnimation *animation = [CABasicAnimation animation]; - animation.keyPath = @"transform.rotation"; - animation.duration = 1.0f; - animation.fromValue = @(0.0f); - animation.toValue = @(2 * M_PI); - animation.repeatCount = INFINITY; - animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - - [self.layer addAnimation:animation forKey:kACPRotationAnimationKey]; - self.animate = YES; - -} -- (void)stopAnimating{ - - if (!self.isAnimating) - return; - - [self.layer removeAnimationForKey:kACPRotationAnimationKey]; - self.animate = NO; - -} - -- (void)updateColor:(UIColor*)color { - self.layer.strokeColor = color.CGColor; -} -- (void)setHidden:(BOOL)hidden { - self.layer.hidden = YES; - -} -- (void)removeLayer { - [self stopAnimating]; - [self.layer removeFromSuperlayer]; -} -@end diff --git a/ACPDownload/ACPLayerProtocol.h b/ACPDownload/ACPLayerProtocol.h deleted file mode 100644 index 85cb6de..0000000 --- a/ACPDownload/ACPLayerProtocol.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// ACPLayerProtocol.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import - -/** - `ACPLayerProtocol` - - ##Purpose - Protocol to define the animated layers in the view container. It is defined for two animated states, Indeterminate and Running. - Any object who conform this protocol could replace any of the animated layer in the project. - @see ACPIndeterminateGoogleLayer ACPIndeterminateLayer - - #Optional methods. - - Indeterminate animation has to conform -startAnimating and -stopAnimating - Progress animation has to conform -setProgress - - @see ACPDownloadConstants; - */ - -@protocol ACPLayerProtocol - -@property (nonatomic, readonly) CAShapeLayer * layer; -@property (nonatomic, readonly) UIColor * colorLayer; -@property (nonatomic, assign, readonly, getter= isAnimating) BOOL animate; - -/** - * This method will set the right frame to layer - * - * @param frame current frame. - */ -- (void)updateFrame:(CGRect)frame; - -/** - * It will change the color of the layer. By default is tintColor. - * - * @param color color - */ -- (void)updateColor:(UIColor*)color; - -/** - * It will hidde the layer. - * - * @param hidden YES is hidden - */ -- (void)setHidden:(BOOL)hidden; - -/** - * Remove Layer, this method remove the animation first, and then remove the layer from superview - */ -- (void)removeLayer; - -@optional - -/** - * This method will start the animation associated. - * @warning the indeterminate layer has to implement it. - */ -- (void)startAnimating; - -/** -* This method will stop the animation associated. -* @warning the indeterminate layer has to implement it. -*/ -- (void)stopAnimating; - -/** - * This method will define the progress of our Progress layer - * @warning the progress layer has to implement it. - * @param progress Float value from 0 to 1. - * @param animated flag. - */ -- (void)setProgress:(float)progress animated:(BOOL)animated; -@end diff --git a/ACPDownload/ACPProgressLayer.h b/ACPDownload/ACPProgressLayer.h deleted file mode 100644 index 747ae61..0000000 --- a/ACPDownload/ACPProgressLayer.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// ACPProgressLayer.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPLayerProtocol.h" - -@interface ACPProgressLayer : NSObject - -@end diff --git a/ACPDownload/ACPProgressLayer.m b/ACPDownload/ACPProgressLayer.m deleted file mode 100644 index eda0c38..0000000 --- a/ACPDownload/ACPProgressLayer.m +++ /dev/null @@ -1,101 +0,0 @@ -// -// ACPProgressLayer.m -// ACPDownload -// -// Created by Palmero, Antonio on 1/16/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPProgressLayer.h" -#import "ACPDownloadConstants.h" - -@interface ACPProgressLayer() - -@property (nonatomic, readwrite) CAShapeLayer * layer; -@property (nonatomic, readwrite) UIColor * colorLayer; -@property (nonatomic, assign) CGRect frame; -@property (nonatomic, assign, readwrite, getter= isAnimating) BOOL animate; -@property (nonatomic, assign) float progress; - -@end - -@implementation ACPProgressLayer - -- (instancetype)init -{ - self = [super init]; - if (self) { - self.progress =0.f; - } - return self; -} -- (CAShapeLayer *) layer { - if (!_layer) { - _layer = [CAShapeLayer layer]; - _layer.strokeColor = self.colorLayer.CGColor; - _layer.fillColor = nil; - _layer.lineWidth = 3.f; - } - return _layer; -} - -- (void)updateFrame:(CGRect)frame { - self.frame = frame; - self.layer.frame = frame; - [self updatePath]; - -} - -- (void)updatePath { - - CGPoint center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); - CGFloat radius = MIN(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) - self.layer.lineWidth / 2; - radius = radius - self.layer.lineWidth/2; - CGFloat startAngle = (CGFloat)(-M_PI/2); - CGFloat endAngle = (CGFloat)(3 * M_PI_2); - UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - self.layer.path = path.CGPath; - -} - -#pragma mark - - -- (void)setProgress:(float)progress { - [self setProgress:progress animated:NO]; -} - -- (void)setProgress:(float)progress animated:(BOOL)animated { - if (progress > 0) { - if (animated) { - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; - animation.fromValue = self.progress == 0 ? @0 : nil; - animation.toValue = @(progress); - animation.duration = 1; - self.layer.strokeEnd = progress; - [self.layer addAnimation:animation forKey:@"animation"]; - } else { - [CATransaction begin]; - [CATransaction setDisableActions:YES]; - self.layer.strokeEnd = progress; - [CATransaction commit]; - } - } else { - self.layer.strokeEnd = 0.0f; - [self.layer removeAnimationForKey:@"animation"]; - } - - _progress = progress; -} - -- (void)updateColor:(UIColor*)color { - self.layer.strokeColor = color.CGColor; -} - -- (void)setHidden:(BOOL)hidden { - self.layer.hidden = YES; - -} -- (void)removeLayer { - [self.layer removeFromSuperlayer]; -} -@end diff --git a/ACPDownload/ACPStaticImages.h b/ACPDownload/ACPStaticImages.h deleted file mode 100644 index d6225bd..0000000 --- a/ACPDownload/ACPStaticImages.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// ACPStaticImages.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 18/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPStaticImagesProtocol.h" - - -@interface ACPStaticImages : NSObject - - -@end diff --git a/ACPDownload/ACPStaticImages.m b/ACPDownload/ACPStaticImages.m deleted file mode 100644 index 5e4fa69..0000000 --- a/ACPDownload/ACPStaticImages.m +++ /dev/null @@ -1,160 +0,0 @@ -// -// ACPStaticImages.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 18/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPStaticImages.h" - -@implementation ACPStaticImages -@synthesize bounds, strokeColor; - -- (void)updateFrame:(CGRect)frame { - self.bounds = frame; -} - -- (void) drawStatusNone{ - - CGRect frameContainer; - frameContainer.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 3; - frameContainer.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 3; - frameContainer.size.width = self.bounds.size.width / 1.5; - frameContainer.size.height = self.bounds.size.height / 1.5; - - //// Bezier Drawing - UIBezierPath* bezierPath = [UIBezierPath bezierPath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.48148 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.88542 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.36111 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.75000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.33333 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.78125 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.96875 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.66667 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.78125 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.63889 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.75000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.51852 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.88542 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.51852 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.41667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.48148 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.41667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.48148 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.88542 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.48148 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.88542 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.44444 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.18529 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.03704 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.10363 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.03704 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.59205 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.15189 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.33759 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.03704 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.42103 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.08610 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.35466 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.15189 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.33759 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.14815 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.29167 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.14943 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.32270 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.14815 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30735 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.37037 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04167 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.14815 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.15360 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.24764 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04167 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.58005 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.20867 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.46724 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04167 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.54963 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.11139 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.68519 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.16667 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.60873 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.18241 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.64532 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.16667 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.85128 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.33846 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.77253 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.16667 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.84418 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.24226 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.85128 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.33846 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.96296 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.91535 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.35680 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.96296 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.42217 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.81471 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.96296 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.59186 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.89659 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.55556 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.55556 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.81484 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.91710 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.61483 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.88455 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30690 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.41265 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.95234 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.33785 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.88455 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30690 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.68519 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.12500 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.86519 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.20301 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.78328 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.12500 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.59607 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.14804 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.65323 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.12500 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.62299 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.13328 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.37037 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.55153 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.05964 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.46714 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.11111 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.29167 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.22719 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.11111 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.13058 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.11155 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30881 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.11111 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.29742 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.11126 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30314 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.11155 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30881 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.04591 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.34090 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.41455 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.18516 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.61506 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.08268 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.44444 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.70833 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.44444 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.44444 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.44444 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.66667 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - bezierPath.miterLimit = 4; - - bezierPath.usesEvenOddFillRule = YES; - - [self.strokeColor setFill]; - [bezierPath fill]; -} -- (void) drawStatusIndeterminate{ - //Nothing, just the layer animation. -} -- (void) drawStatusRunning{ - - CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); - CGFloat radius = (MIN(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) / 2))-1; - CGFloat startAngle = (CGFloat)(0); - CGFloat endAngle = (CGFloat)(2*M_PI); - - - //// Oval Drawing - UIBezierPath* ovalPath = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - [[UIColor clearColor] setFill]; - [ovalPath fill]; - [self.strokeColor setStroke]; - ovalPath.lineWidth = 1.5; - [ovalPath stroke]; - - CGRect page1 = self.bounds; - page1.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 8; - page1.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 8; - page1.size.width = self.bounds.size.width / 4; - page1.size.height = self.bounds.size.height /4; - - //// Rectangle Drawing - UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRect: page1]; - [self.strokeColor setFill]; - [rectanglePath fill]; - -} -- (void) drawStatusComplete{ - - CGRect frameContainer; - - frameContainer.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 3; - frameContainer.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 3; - frameContainer.size.width = self.bounds.size.width / 1.5; - frameContainer.size.height = self.bounds.size.height / 1.5; - - //// Bezier Drawing - UIBezierPath* bezierPath = [UIBezierPath bezierPath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.77614 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.77614 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.22386 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.77614 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.22386 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.22386 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.77614 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.22386 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.95455 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.95455 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.75104 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.95455 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.95455 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.75104 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04545 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.95455 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.24896 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.75104 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04545 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.04545 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.24896 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.04545 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.04545 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.24896 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.95455 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.04545 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.75104 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.24896 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.95455 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.30715 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72499 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.27501 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.69285 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.46786 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.27501 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30715 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.30715 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.27501 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.46786 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.69285 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.27501 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.72499 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.30715 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.53214 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.72499 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.69285 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.69285 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72499 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.53214 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.30715 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72499 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - bezierPath.miterLimit = 4; - - bezierPath.usesEvenOddFillRule = YES; - - [self.strokeColor setFill]; - [bezierPath fill]; -} - - -- (void)updateColor:(UIColor*)color { - self.strokeColor = color; -} -@end diff --git a/ACPDownload/ACPStaticImagesAlternative.h b/ACPDownload/ACPStaticImagesAlternative.h deleted file mode 100644 index b086511..0000000 --- a/ACPDownload/ACPStaticImagesAlternative.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// ACPStaticImagesAlternative.h -// ACPDownload -// -// Created by Palmero, Antonio on 1/19/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPStaticImagesProtocol.h" -@interface ACPStaticImagesAlternative : NSObject - - -@end diff --git a/ACPDownload/ACPStaticImagesAlternative.m b/ACPDownload/ACPStaticImagesAlternative.m deleted file mode 100644 index d8b3986..0000000 --- a/ACPDownload/ACPStaticImagesAlternative.m +++ /dev/null @@ -1,140 +0,0 @@ -// -// ACPStaticImagesAlternative.m -// ACPDownload -// -// Created by Palmero, Antonio on 1/19/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ACPStaticImagesAlternative.h" - -@implementation ACPStaticImagesAlternative - -@synthesize strokeColor,bounds; - -- (void)updateFrame:(CGRect)frame { - self.bounds = frame; -} - -- (void)updateColor:(UIColor*)color { - self.strokeColor = color; -} - -- (void) drawStatusNone{ - CGRect frameContainer; - frameContainer.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 3; - frameContainer.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 3; - frameContainer.size.width = self.bounds.size.width / 1.5; - frameContainer.size.height = self.bounds.size.height / 1.5; - - CGRect groupInFrame = CGRectMake(CGRectGetMinX(frameContainer) + floor(CGRectGetWidth(frameContainer) * 0.09375 + 0.5), CGRectGetMinY(frameContainer) + floor(CGRectGetHeight(frameContainer) * 0.02539 + 0.5), floor(CGRectGetWidth(frameContainer) * 0.90625 + 0.5) - floor(CGRectGetWidth(frameContainer) * 0.09375 + 0.5), floor(CGRectGetHeight(frameContainer) * 1.00000 + 0.5) - floor(CGRectGetHeight(frameContainer) * 0.02539 + 0.5)); - - //Arrow - UIBezierPath* bezierPath = [UIBezierPath bezierPath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.28199 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.49896 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.24671 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.52837 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.50026 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.73975 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.75381 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.52837 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.71853 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.49896 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.52521 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.66013 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.52521 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.00179 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.47531 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.00179 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.47531 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.66013 * CGRectGetHeight(groupInFrame))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.28199 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.49896 * CGRectGetHeight(groupInFrame))]; - [bezierPath closePath]; - bezierPath.miterLimit = 4; - - [self.strokeColor setFill]; - [bezierPath fill]; - - - //Cube - UIBezierPath* bezier2Path = [UIBezierPath bezierPath]; - [bezier2Path moveToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.62499 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.20975 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.62499 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.25134 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.94928 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.25134 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.94928 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.95841 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.05125 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.95841 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.05125 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.25134 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.37553 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.25134 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.37553 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.20975 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.00135 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.20975 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.00135 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 1.00000 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.99917 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 1.00000 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.99917 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.20975 * CGRectGetHeight(groupInFrame))]; - [bezier2Path addLineToPoint: CGPointMake(CGRectGetMinX(groupInFrame) + 0.62499 * CGRectGetWidth(groupInFrame), CGRectGetMinY(groupInFrame) + 0.20975 * CGRectGetHeight(groupInFrame))]; - [bezier2Path closePath]; - bezier2Path.miterLimit = 4; - - [self.strokeColor setFill]; - [bezier2Path fill]; - - - - -} -- (void) drawStatusIndeterminate{ - //Nothing, just the layer animation. -} -- (void) drawStatusRunning{ - - CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); - CGFloat radius = (MIN(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) / 2))-1; - CGFloat startAngle = (CGFloat)(0); - CGFloat endAngle = (CGFloat)(2*M_PI); - - - //// The circle - UIBezierPath* ovalPath = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - [[UIColor clearColor] setFill]; - [ovalPath fill]; - [self.strokeColor setStroke]; - ovalPath.lineWidth = 1.5; - [ovalPath stroke]; - - CGRect page1 = self.bounds; - page1.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 8; - page1.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 8; - page1.size.width = self.bounds.size.width / 4; - page1.size.height = self.bounds.size.height /4; - - //// The stop in the middle - UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRect: page1]; - [self.strokeColor setFill]; - [rectanglePath fill]; - -} -- (void) drawStatusComplete{ - - CGRect frameContainer; - frameContainer.origin.x = CGRectGetMidX(self.bounds) - self.bounds.size.width / 3; - frameContainer.origin.y = CGRectGetMidY(self.bounds) - self.bounds.size.height / 3; - frameContainer.size.width = self.bounds.size.width / 1.5; - frameContainer.size.height = self.bounds.size.height / 1.5; - - UIBezierPath* bezierPath = [UIBezierPath bezierPath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.22500 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.22500 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.77500 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.22500 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 0.77500 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 1.00000 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.77500 * CGRectGetHeight(frameContainer))]; - [bezierPath addCurveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer)) controlPoint1: CGPointMake(CGRectGetMinX(frameContainer) + 1.00000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.22500 * CGRectGetHeight(frameContainer)) controlPoint2: CGPointMake(CGRectGetMinX(frameContainer) + 0.77500 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.50000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.00000 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - [bezierPath moveToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.40000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72500 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.40000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.27500 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.70000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.50000 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.40000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72500 * CGRectGetHeight(frameContainer))]; - [bezierPath addLineToPoint: CGPointMake(CGRectGetMinX(frameContainer) + 0.40000 * CGRectGetWidth(frameContainer), CGRectGetMinY(frameContainer) + 0.72500 * CGRectGetHeight(frameContainer))]; - [bezierPath closePath]; - bezierPath.miterLimit = 4; - - bezierPath.usesEvenOddFillRule = YES; - - [self.strokeColor setFill]; - [bezierPath fill]; - -} - - - -@end diff --git a/ACPDownload/ACPStaticImagesProtocol.h b/ACPDownload/ACPStaticImagesProtocol.h deleted file mode 100644 index 7766824..0000000 --- a/ACPDownload/ACPStaticImagesProtocol.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// ACPStaticImages.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 18/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import - - -/** - `ACPStaticImagesProtocol` - - ##Purpose - Protocol to define the set of static images for any state in the main view. - @see ACPStaticImagesAlternative ACPStaticImages - - ##Note - No need for different resolutions, UIBezierPath is used to paint the images. - - @see UIBezierPath; - */ - -@protocol ACPStaticImagesProtocol -/** - * Basic properties. - */ -@property (nonatomic, assign) CGRect bounds; -@property (nonatomic, strong) UIColor * strokeColor; - -/** - * Draw the image for the ACPDownloadStatusNone - */ -- (void) drawStatusNone; - -/** - * Draw the image for the ACPDownloadStatusIndeterminate - */ -- (void) drawStatusIndeterminate; - -/** - * Draw the image for the ACPDownloadStatusRunning - */ -- (void) drawStatusRunning; - -/** - * Draw the image for the ACPDownloadStatusCompleted - */ -- (void) drawStatusComplete; - -/** - * Update the color of the images. By default is the tintColor. - * - * @param color Color selected. - */ -- (void) updateColor:(UIColor*)color; - -/** -* This method will set the right frame to layer -* -* @param frame current frame. -*/ -- (void)updateFrame:(CGRect)frame; -@end diff --git a/Example/AppDelegate.h b/Example/AppDelegate.h deleted file mode 100644 index 1aa214c..0000000 --- a/Example/AppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDelegate.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - - -@end - diff --git a/Example/AppDelegate.m b/Example/AppDelegate.m deleted file mode 100644 index d237c37..0000000 --- a/Example/AppDelegate.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// AppDelegate.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // 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. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // 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. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // 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. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/Example/Base.lproj/LaunchScreen.xib b/Example/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 331e1b1..0000000 --- a/Example/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Base.lproj/Main.storyboard b/Example/Base.lproj/Main.storyboard deleted file mode 100644 index 52f8104..0000000 --- a/Example/Base.lproj/Main.storyboard +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/ExampleCell.h b/Example/ExampleCell.h deleted file mode 100644 index e7ca0e8..0000000 --- a/Example/ExampleCell.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// ExampleCell.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 18/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "ACPDownloadView.h" - -@interface ExampleCell : UITableViewCell - -@property (weak, nonatomic) IBOutlet UILabel *exampleLabel; -@property (weak, nonatomic) IBOutlet ACPDownloadView *exampleIndicator; - - -@end diff --git a/Example/ExampleCell.m b/Example/ExampleCell.m deleted file mode 100644 index 2dd3086..0000000 --- a/Example/ExampleCell.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// ExampleCell.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 18/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ExampleCell.h" - -@implementation ExampleCell - -@end diff --git a/Example/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80..0000000 --- a/Example/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example/Info.plist b/Example/Info.plist deleted file mode 100644 index e38a3bd..0000000 --- a/Example/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - Uttopia.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Example/ViewController.h b/Example/ViewController.h deleted file mode 100644 index 378cb59..0000000 --- a/Example/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/Example/ViewController.m b/Example/ViewController.m deleted file mode 100644 index aa39dc8..0000000 --- a/Example/ViewController.m +++ /dev/null @@ -1,118 +0,0 @@ -// -// ViewController.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import "ViewController.h" -#import "ACPDownloadView.h" -#import "ACPIndeterminateGoogleLayer.h" -#import "ExampleCell.h" -#import "ACPStaticImagesAlternative.h" -@interface ViewController () -{ - NSTimer *_timer; -} -@property (weak, nonatomic) IBOutlet ACPDownloadView *downloadView; -@property (nonatomic, assign) float progress; -@end - -@implementation ViewController - - -- (void)viewDidLoad { - [super viewDidLoad]; - - // If you want to change the animation in the indeterminate state - ACPIndeterminateGoogleLayer * layer = [ACPIndeterminateGoogleLayer new]; - [layer updateColor:[UIColor blueColor]]; - [self.downloadView setIndeterminateLayer:layer]; - - // You can define a behaviour if the view is tapped. (Optional) - [self.downloadView setActionForTap:^(ACPDownloadView *downloadView, ACPDownloadStatus status){ - switch (status) { - case ACPDownloadStatusNone: - [downloadView setIndicatorStatus:ACPDownloadStatusIndeterminate]; - break; - case ACPDownloadStatusRunning: - [downloadView setIndicatorStatus:ACPDownloadStatusCompleted]; - break; - case ACPDownloadStatusIndeterminate: - [downloadView setIndicatorStatus:ACPDownloadStatusRunning]; - break; - case ACPDownloadStatusCompleted: - [downloadView setIndicatorStatus:ACPDownloadStatusNone]; - break; - - default: - break; - } - }]; - // This timer has been written just for testing purposes. It's running and changing the value of the progress variable constantly. - _timer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(increment:) userInfo:nil repeats:YES]; -} - -- (void)increment:(NSTimer *)timer { - - self.progress = (self.progress <= 0.8f ? self.progress + 0.2f : 0.0f); - NSLog(@"Progress %f", self.progress); - [self.downloadView setProgress:self.progress animated:YES]; -} - -#pragma mark - Tableview configuration. - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 25; -} - - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString* cellIdentifier = @"Cell"; - ExampleCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; - - cell.exampleLabel.text = [NSString stringWithFormat:@"Package %zd", indexPath.row]; - - // If you want to change the images presented - ACPStaticImagesAlternative * myOwnImages = [ACPStaticImagesAlternative new]; - [myOwnImages updateColor:cell.tintColor]; - [cell.exampleIndicator setImages:myOwnImages]; - - //Status by default. - [cell.exampleIndicator setIndicatorStatus:ACPDownloadStatusNone]; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - ExampleCell * cellSelected = (ExampleCell*)[tableView cellForRowAtIndexPath:indexPath]; - - switch (cellSelected.exampleIndicator.currentStatus - ) { - case ACPDownloadStatusNone: - [cellSelected.exampleIndicator setIndicatorStatus:ACPDownloadStatusIndeterminate]; - break; - case ACPDownloadStatusRunning: - [cellSelected.exampleIndicator setIndicatorStatus:ACPDownloadStatusCompleted]; - break; - case ACPDownloadStatusIndeterminate: - [cellSelected.exampleIndicator setIndicatorStatus:ACPDownloadStatusRunning]; - [cellSelected.exampleIndicator setProgress:self.progress animated:YES]; - break; - case ACPDownloadStatusCompleted: - [cellSelected.exampleIndicator setIndicatorStatus:ACPDownloadStatusNone]; - break; - - default: - break; - } - - -} - -@end diff --git a/Example/main.m b/Example/main.m deleted file mode 100644 index 10fe2ca..0000000 --- a/Example/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// ACPDownload -// -// Created by Antonio Casero Palmero on 10/01/15. -// Copyright (c) 2015 Antonio Casero Palmero. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e874435..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Antonio Casero - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/screenshots/acpdownload-gif.gif b/screenshots/acpdownload-gif.gif new file mode 100644 index 0000000..1274a6c Binary files /dev/null and b/screenshots/acpdownload-gif.gif differ diff --git a/screenshots/acpdownload-screenshot-1.png b/screenshots/acpdownload-screenshot-1.png new file mode 100644 index 0000000..7b7b2e7 Binary files /dev/null and b/screenshots/acpdownload-screenshot-1.png differ diff --git a/screenshots/acpdownload-screenshot-2.png b/screenshots/acpdownload-screenshot-2.png new file mode 100644 index 0000000..b6214c7 Binary files /dev/null and b/screenshots/acpdownload-screenshot-2.png differ