├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── AHDownloadButton.podspec ├── Demo.gif ├── Example ├── AHDownloadButton.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── AHDownloadButton-Example.xcscheme ├── AHDownloadButton.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── AHDownloadButton │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── DownloadViewController.swift │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── Info.plist ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── AHDownloadButton.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── AHDownloadButton.xcscheme │ └── Target Support Files │ │ ├── AHDownloadButton │ │ ├── AHDownloadButton-dummy.m │ │ ├── AHDownloadButton-prefix.pch │ │ ├── AHDownloadButton-umbrella.h │ │ ├── AHDownloadButton.modulemap │ │ ├── AHDownloadButton.xcconfig │ │ └── Info.plist │ │ ├── Pods-AHDownloadButton_Example │ │ ├── Info.plist │ │ ├── Pods-AHDownloadButton_Example-acknowledgements.markdown │ │ ├── Pods-AHDownloadButton_Example-acknowledgements.plist │ │ ├── Pods-AHDownloadButton_Example-dummy.m │ │ ├── Pods-AHDownloadButton_Example-frameworks.sh │ │ ├── Pods-AHDownloadButton_Example-resources.sh │ │ ├── Pods-AHDownloadButton_Example-umbrella.h │ │ ├── Pods-AHDownloadButton_Example.debug.xcconfig │ │ ├── Pods-AHDownloadButton_Example.modulemap │ │ └── Pods-AHDownloadButton_Example.release.xcconfig │ │ └── Pods-AHDownloadButton_Tests │ │ ├── Info.plist │ │ ├── Pods-AHDownloadButton_Tests-acknowledgements.markdown │ │ ├── Pods-AHDownloadButton_Tests-acknowledgements.plist │ │ ├── Pods-AHDownloadButton_Tests-dummy.m │ │ ├── Pods-AHDownloadButton_Tests-frameworks.sh │ │ ├── Pods-AHDownloadButton_Tests-resources.sh │ │ ├── Pods-AHDownloadButton_Tests-umbrella.h │ │ ├── Pods-AHDownloadButton_Tests.debug.xcconfig │ │ ├── Pods-AHDownloadButton_Tests.modulemap │ │ └── Pods-AHDownloadButton_Tests.release.xcconfig └── Tests │ ├── AHDownloadButtonDelegateMock.swift │ ├── AHDownloadButtonTests.swift │ ├── CircleViewTests.swift │ ├── HighlightableRoundedButtonTests.swift │ ├── HorizontalAlignmentTests.swift │ ├── Info.plist │ └── ProgressButtonTests.swift ├── LICENSE ├── Logo.png ├── Package.swift ├── README.md ├── Sources └── AHDownloadButton │ ├── Assets │ └── .gitkeep │ └── Classes │ ├── .gitkeep │ ├── AHDownloadButton+StateTransitionAnimation.swift │ ├── AHDownloadButton.swift │ ├── CircleView.swift │ ├── Color.swift │ ├── HighlightableRoundedButton.swift │ ├── ProgressButton.swift │ ├── ProgressCircleView.swift │ ├── UIButton+TitleWidth.swift │ └── UIView+Constraint.swift └── carthage.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AHDownloadButton.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'AHDownloadButton' 3 | s.version = '1.3.0' 4 | s.summary = 'Customisable download button with progress animation' 5 | 6 | s.description = <<-DESC 7 | AHDownloadButton is a customisable download button similar to the download button in the latest version of Apple's App Store app (since iOS 11). 8 | It features download progress animation as well as animated transitions between download states: start download, pending, downloading and downloaded. 9 | DESC 10 | 11 | s.homepage = 'https://github.com/amerhukic/AHDownloadButton' 12 | s.license = { :type => 'MIT', :file => 'LICENSE' } 13 | s.author = { 'Amer Hukić' => 'hukicamer@gmail.com' } 14 | s.source = { :git => 'https://github.com/amerhukic/AHDownloadButton.git', :tag => s.version.to_s } 15 | s.social_media_url = 'https://twitter.com/hukicamer' 16 | 17 | s.ios.deployment_target = '8.0' 18 | s.source_files = 'Sources/AHDownloadButton/Classes/**/*' 19 | s.frameworks = 'UIKit' 20 | s.swift_version = '5.0' 21 | end 22 | -------------------------------------------------------------------------------- /Demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/AHDownloadButton/5ea4c1d39d7931201dac0b08eaadb1a5904e27be/Demo.gif -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 19C0725A21FF32E00081B420 /* CircleViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0725921FF32E00081B420 /* CircleViewTests.swift */; }; 11 | 19C0725E21FF902C0081B420 /* ProgressButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0725D21FF902C0081B420 /* ProgressButtonTests.swift */; }; 12 | 19C0726021FFA2230081B420 /* HighlightableRoundedButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0725F21FFA2230081B420 /* HighlightableRoundedButtonTests.swift */; }; 13 | 19C0726221FFA4D20081B420 /* AHDownloadButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0726121FFA4D20081B420 /* AHDownloadButtonTests.swift */; }; 14 | 19C0726622005A720081B420 /* AHDownloadButtonDelegateMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C07264220059E10081B420 /* AHDownloadButtonDelegateMock.swift */; }; 15 | 19C0726A2201F6730081B420 /* HorizontalAlignmentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C072692201F6730081B420 /* HorizontalAlignmentTests.swift */; }; 16 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 17 | 607FACD81AFB9204008FA782 /* DownloadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* DownloadViewController.swift */; }; 18 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 19 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 20 | D9E1BAE1A47B8C79B3EB6A24 /* Pods_AHDownloadButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8499D8AA25BEB358EB96FFD /* Pods_AHDownloadButton_Example.framework */; }; 21 | FA1A504BC61ED8CE19ABD332 /* Pods_AHDownloadButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B1E2116AD5843C693919D1D /* Pods_AHDownloadButton_Tests.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 30 | remoteInfo = AHDownloadButton; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 023A2A6DD90614A817E77D09 /* Pods-AHDownloadButton_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.release.xcconfig"; sourceTree = ""; }; 36 | 19225E942687696B003BE6D8 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Package.swift; path = ../Package.swift; sourceTree = ""; }; 37 | 19C0725921FF32E00081B420 /* CircleViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleViewTests.swift; sourceTree = ""; }; 38 | 19C0725D21FF902C0081B420 /* ProgressButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressButtonTests.swift; sourceTree = ""; }; 39 | 19C0725F21FFA2230081B420 /* HighlightableRoundedButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightableRoundedButtonTests.swift; sourceTree = ""; }; 40 | 19C0726121FFA4D20081B420 /* AHDownloadButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AHDownloadButtonTests.swift; sourceTree = ""; }; 41 | 19C07264220059E10081B420 /* AHDownloadButtonDelegateMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AHDownloadButtonDelegateMock.swift; sourceTree = ""; }; 42 | 19C072692201F6730081B420 /* HorizontalAlignmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HorizontalAlignmentTests.swift; sourceTree = ""; }; 43 | 3B1E2116AD5843C693919D1D /* Pods_AHDownloadButton_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AHDownloadButton_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 607FACD01AFB9204008FA782 /* AHDownloadButton_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AHDownloadButton_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 47 | 607FACD71AFB9204008FA782 /* DownloadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadViewController.swift; sourceTree = ""; }; 48 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 49 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 50 | 607FACE51AFB9204008FA782 /* AHDownloadButton_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AHDownloadButton_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 67CF4BFAD38CEE7D0694966C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 53 | 7929F5F7A75146180BC214F9 /* Pods-AHDownloadButton_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.debug.xcconfig"; sourceTree = ""; }; 54 | 93119861EEF364B63633C26D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 55 | B8499D8AA25BEB358EB96FFD /* Pods_AHDownloadButton_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AHDownloadButton_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | C9058B0578548461E8B23A49 /* AHDownloadButton.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = AHDownloadButton.podspec; path = ../AHDownloadButton.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 57 | D30B8FFC1198B90747524EB6 /* Pods-AHDownloadButton_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.release.xcconfig"; sourceTree = ""; }; 58 | F872A62AE582B051C2615CDA /* Pods-AHDownloadButton_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.debug.xcconfig"; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | D9E1BAE1A47B8C79B3EB6A24 /* Pods_AHDownloadButton_Example.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | FA1A504BC61ED8CE19ABD332 /* Pods_AHDownloadButton_Tests.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 19C07263220059CA0081B420 /* Mocks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 19C07264220059E10081B420 /* AHDownloadButtonDelegateMock.swift */, 85 | ); 86 | name = Mocks; 87 | sourceTree = ""; 88 | }; 89 | 3ECFBFDBAF4BF0E76921C002 /* Pods */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 7929F5F7A75146180BC214F9 /* Pods-AHDownloadButton_Example.debug.xcconfig */, 93 | 023A2A6DD90614A817E77D09 /* Pods-AHDownloadButton_Example.release.xcconfig */, 94 | F872A62AE582B051C2615CDA /* Pods-AHDownloadButton_Tests.debug.xcconfig */, 95 | D30B8FFC1198B90747524EB6 /* Pods-AHDownloadButton_Tests.release.xcconfig */, 96 | ); 97 | name = Pods; 98 | sourceTree = ""; 99 | }; 100 | 607FACC71AFB9204008FA782 = { 101 | isa = PBXGroup; 102 | children = ( 103 | 607FACF51AFB993E008FA782 /* Metadata */, 104 | 607FACD21AFB9204008FA782 /* Example for AHDownloadButton */, 105 | 607FACE81AFB9204008FA782 /* Tests */, 106 | 607FACD11AFB9204008FA782 /* Products */, 107 | 3ECFBFDBAF4BF0E76921C002 /* Pods */, 108 | F2F732821F47C472BDE464B2 /* Frameworks */, 109 | ); 110 | sourceTree = ""; 111 | }; 112 | 607FACD11AFB9204008FA782 /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 607FACD01AFB9204008FA782 /* AHDownloadButton_Example.app */, 116 | 607FACE51AFB9204008FA782 /* AHDownloadButton_Tests.xctest */, 117 | ); 118 | name = Products; 119 | sourceTree = ""; 120 | }; 121 | 607FACD21AFB9204008FA782 /* Example for AHDownloadButton */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 125 | 607FACD71AFB9204008FA782 /* DownloadViewController.swift */, 126 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 127 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 128 | 607FACD31AFB9204008FA782 /* Supporting Files */, 129 | ); 130 | name = "Example for AHDownloadButton"; 131 | path = AHDownloadButton; 132 | sourceTree = ""; 133 | }; 134 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 607FACD41AFB9204008FA782 /* Info.plist */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | 607FACE81AFB9204008FA782 /* Tests */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 19C0726121FFA4D20081B420 /* AHDownloadButtonTests.swift */, 146 | 19C072692201F6730081B420 /* HorizontalAlignmentTests.swift */, 147 | 19C0725F21FFA2230081B420 /* HighlightableRoundedButtonTests.swift */, 148 | 19C0725D21FF902C0081B420 /* ProgressButtonTests.swift */, 149 | 19C0725921FF32E00081B420 /* CircleViewTests.swift */, 150 | 19C07263220059CA0081B420 /* Mocks */, 151 | 607FACE91AFB9204008FA782 /* Supporting Files */, 152 | ); 153 | path = Tests; 154 | sourceTree = ""; 155 | }; 156 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 607FACEA1AFB9204008FA782 /* Info.plist */, 160 | ); 161 | name = "Supporting Files"; 162 | sourceTree = ""; 163 | }; 164 | 607FACF51AFB993E008FA782 /* Metadata */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 19225E942687696B003BE6D8 /* Package.swift */, 168 | C9058B0578548461E8B23A49 /* AHDownloadButton.podspec */, 169 | 67CF4BFAD38CEE7D0694966C /* README.md */, 170 | 93119861EEF364B63633C26D /* LICENSE */, 171 | ); 172 | name = Metadata; 173 | sourceTree = ""; 174 | }; 175 | F2F732821F47C472BDE464B2 /* Frameworks */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | B8499D8AA25BEB358EB96FFD /* Pods_AHDownloadButton_Example.framework */, 179 | 3B1E2116AD5843C693919D1D /* Pods_AHDownloadButton_Tests.framework */, 180 | ); 181 | name = Frameworks; 182 | sourceTree = ""; 183 | }; 184 | /* End PBXGroup section */ 185 | 186 | /* Begin PBXNativeTarget section */ 187 | 607FACCF1AFB9204008FA782 /* AHDownloadButton_Example */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AHDownloadButton_Example" */; 190 | buildPhases = ( 191 | 371CCFDA1DDB60ADE47D4116 /* [CP] Check Pods Manifest.lock */, 192 | 607FACCC1AFB9204008FA782 /* Sources */, 193 | 607FACCD1AFB9204008FA782 /* Frameworks */, 194 | 607FACCE1AFB9204008FA782 /* Resources */, 195 | 658A18D2FB630CF6F8BDF4E9 /* [CP] Embed Pods Frameworks */, 196 | 663F0B085FD60ECB948AAF45 /* [CP] Copy Pods Resources */, 197 | ); 198 | buildRules = ( 199 | ); 200 | dependencies = ( 201 | ); 202 | name = AHDownloadButton_Example; 203 | productName = AHDownloadButton; 204 | productReference = 607FACD01AFB9204008FA782 /* AHDownloadButton_Example.app */; 205 | productType = "com.apple.product-type.application"; 206 | }; 207 | 607FACE41AFB9204008FA782 /* AHDownloadButton_Tests */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AHDownloadButton_Tests" */; 210 | buildPhases = ( 211 | FB07FAAE261A0610C3177269 /* [CP] Check Pods Manifest.lock */, 212 | 607FACE11AFB9204008FA782 /* Sources */, 213 | 607FACE21AFB9204008FA782 /* Frameworks */, 214 | 607FACE31AFB9204008FA782 /* Resources */, 215 | DED09F98319F3213DF86AE40 /* [CP] Embed Pods Frameworks */, 216 | 8CA6CA34548A0353AC1AF921 /* [CP] Copy Pods Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 222 | ); 223 | name = AHDownloadButton_Tests; 224 | productName = Tests; 225 | productReference = 607FACE51AFB9204008FA782 /* AHDownloadButton_Tests.xctest */; 226 | productType = "com.apple.product-type.bundle.unit-test"; 227 | }; 228 | /* End PBXNativeTarget section */ 229 | 230 | /* Begin PBXProject section */ 231 | 607FACC81AFB9204008FA782 /* Project object */ = { 232 | isa = PBXProject; 233 | attributes = { 234 | LastSwiftUpdateCheck = 0830; 235 | LastUpgradeCheck = 1220; 236 | ORGANIZATIONNAME = CocoaPods; 237 | TargetAttributes = { 238 | 607FACCF1AFB9204008FA782 = { 239 | CreatedOnToolsVersion = 6.3.1; 240 | LastSwiftMigration = 1020; 241 | }; 242 | 607FACE41AFB9204008FA782 = { 243 | CreatedOnToolsVersion = 6.3.1; 244 | LastSwiftMigration = 1020; 245 | TestTargetID = 607FACCF1AFB9204008FA782; 246 | }; 247 | }; 248 | }; 249 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "AHDownloadButton" */; 250 | compatibilityVersion = "Xcode 3.2"; 251 | developmentRegion = en; 252 | hasScannedForEncodings = 0; 253 | knownRegions = ( 254 | en, 255 | Base, 256 | ); 257 | mainGroup = 607FACC71AFB9204008FA782; 258 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | 607FACCF1AFB9204008FA782 /* AHDownloadButton_Example */, 263 | 607FACE41AFB9204008FA782 /* AHDownloadButton_Tests */, 264 | ); 265 | }; 266 | /* End PBXProject section */ 267 | 268 | /* Begin PBXResourcesBuildPhase section */ 269 | 607FACCE1AFB9204008FA782 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 274 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | 607FACE31AFB9204008FA782 /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXResourcesBuildPhase section */ 286 | 287 | /* Begin PBXShellScriptBuildPhase section */ 288 | 371CCFDA1DDB60ADE47D4116 /* [CP] Check Pods Manifest.lock */ = { 289 | isa = PBXShellScriptBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | ); 293 | inputPaths = ( 294 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 295 | "${PODS_ROOT}/Manifest.lock", 296 | ); 297 | name = "[CP] Check Pods Manifest.lock"; 298 | outputPaths = ( 299 | "$(DERIVED_FILE_DIR)/Pods-AHDownloadButton_Example-checkManifestLockResult.txt", 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | shellPath = /bin/sh; 303 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 304 | showEnvVarsInLog = 0; 305 | }; 306 | 658A18D2FB630CF6F8BDF4E9 /* [CP] Embed Pods Frameworks */ = { 307 | isa = PBXShellScriptBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | ); 311 | inputPaths = ( 312 | "${SRCROOT}/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-frameworks.sh", 313 | "${BUILT_PRODUCTS_DIR}/AHDownloadButton/AHDownloadButton.framework", 314 | ); 315 | name = "[CP] Embed Pods Frameworks"; 316 | outputPaths = ( 317 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AHDownloadButton.framework", 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | shellPath = /bin/sh; 321 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-frameworks.sh\"\n"; 322 | showEnvVarsInLog = 0; 323 | }; 324 | 663F0B085FD60ECB948AAF45 /* [CP] Copy Pods Resources */ = { 325 | isa = PBXShellScriptBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | ); 329 | inputPaths = ( 330 | ); 331 | name = "[CP] Copy Pods Resources"; 332 | outputPaths = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | shellPath = /bin/sh; 336 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-resources.sh\"\n"; 337 | showEnvVarsInLog = 0; 338 | }; 339 | 8CA6CA34548A0353AC1AF921 /* [CP] Copy Pods Resources */ = { 340 | isa = PBXShellScriptBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | inputPaths = ( 345 | ); 346 | name = "[CP] Copy Pods Resources"; 347 | outputPaths = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-resources.sh\"\n"; 352 | showEnvVarsInLog = 0; 353 | }; 354 | DED09F98319F3213DF86AE40 /* [CP] Embed Pods Frameworks */ = { 355 | isa = PBXShellScriptBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | inputPaths = ( 360 | ); 361 | name = "[CP] Embed Pods Frameworks"; 362 | outputPaths = ( 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | shellPath = /bin/sh; 366 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-frameworks.sh\"\n"; 367 | showEnvVarsInLog = 0; 368 | }; 369 | FB07FAAE261A0610C3177269 /* [CP] Check Pods Manifest.lock */ = { 370 | isa = PBXShellScriptBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | ); 374 | inputPaths = ( 375 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 376 | "${PODS_ROOT}/Manifest.lock", 377 | ); 378 | name = "[CP] Check Pods Manifest.lock"; 379 | outputPaths = ( 380 | "$(DERIVED_FILE_DIR)/Pods-AHDownloadButton_Tests-checkManifestLockResult.txt", 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | shellPath = /bin/sh; 384 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 385 | showEnvVarsInLog = 0; 386 | }; 387 | /* End PBXShellScriptBuildPhase section */ 388 | 389 | /* Begin PBXSourcesBuildPhase section */ 390 | 607FACCC1AFB9204008FA782 /* Sources */ = { 391 | isa = PBXSourcesBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | 607FACD81AFB9204008FA782 /* DownloadViewController.swift in Sources */, 395 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | }; 399 | 607FACE11AFB9204008FA782 /* Sources */ = { 400 | isa = PBXSourcesBuildPhase; 401 | buildActionMask = 2147483647; 402 | files = ( 403 | 19C0725E21FF902C0081B420 /* ProgressButtonTests.swift in Sources */, 404 | 19C0726622005A720081B420 /* AHDownloadButtonDelegateMock.swift in Sources */, 405 | 19C0726021FFA2230081B420 /* HighlightableRoundedButtonTests.swift in Sources */, 406 | 19C0726A2201F6730081B420 /* HorizontalAlignmentTests.swift in Sources */, 407 | 19C0726221FFA4D20081B420 /* AHDownloadButtonTests.swift in Sources */, 408 | 19C0725A21FF32E00081B420 /* CircleViewTests.swift in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | /* End PBXSourcesBuildPhase section */ 413 | 414 | /* Begin PBXTargetDependency section */ 415 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 416 | isa = PBXTargetDependency; 417 | target = 607FACCF1AFB9204008FA782 /* AHDownloadButton_Example */; 418 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 419 | }; 420 | /* End PBXTargetDependency section */ 421 | 422 | /* Begin PBXVariantGroup section */ 423 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 424 | isa = PBXVariantGroup; 425 | children = ( 426 | 607FACDF1AFB9204008FA782 /* Base */, 427 | ); 428 | name = LaunchScreen.xib; 429 | sourceTree = ""; 430 | }; 431 | /* End PBXVariantGroup section */ 432 | 433 | /* Begin XCBuildConfiguration section */ 434 | 607FACED1AFB9204008FA782 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 439 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 440 | CLANG_CXX_LIBRARY = "libc++"; 441 | CLANG_ENABLE_MODULES = YES; 442 | CLANG_ENABLE_OBJC_ARC = YES; 443 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_COMMA = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 448 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 449 | CLANG_WARN_EMPTY_BODY = YES; 450 | CLANG_WARN_ENUM_CONVERSION = YES; 451 | CLANG_WARN_INFINITE_RECURSION = YES; 452 | CLANG_WARN_INT_CONVERSION = YES; 453 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 455 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 456 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 457 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 458 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 459 | CLANG_WARN_STRICT_PROTOTYPES = YES; 460 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 461 | CLANG_WARN_UNREACHABLE_CODE = YES; 462 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 463 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 464 | COPY_PHASE_STRIP = NO; 465 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 466 | ENABLE_STRICT_OBJC_MSGSEND = YES; 467 | ENABLE_TESTABILITY = YES; 468 | GCC_C_LANGUAGE_STANDARD = gnu99; 469 | GCC_DYNAMIC_NO_PIC = NO; 470 | GCC_NO_COMMON_BLOCKS = YES; 471 | GCC_OPTIMIZATION_LEVEL = 0; 472 | GCC_PREPROCESSOR_DEFINITIONS = ( 473 | "DEBUG=1", 474 | "$(inherited)", 475 | ); 476 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 477 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 478 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 479 | GCC_WARN_UNDECLARED_SELECTOR = YES; 480 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 481 | GCC_WARN_UNUSED_FUNCTION = YES; 482 | GCC_WARN_UNUSED_VARIABLE = YES; 483 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 484 | MTL_ENABLE_DEBUG_INFO = YES; 485 | ONLY_ACTIVE_ARCH = YES; 486 | SDKROOT = iphoneos; 487 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 488 | }; 489 | name = Debug; 490 | }; 491 | 607FACEE1AFB9204008FA782 /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | ALWAYS_SEARCH_USER_PATHS = NO; 495 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 496 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 497 | CLANG_CXX_LIBRARY = "libc++"; 498 | CLANG_ENABLE_MODULES = YES; 499 | CLANG_ENABLE_OBJC_ARC = YES; 500 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 501 | CLANG_WARN_BOOL_CONVERSION = YES; 502 | CLANG_WARN_COMMA = YES; 503 | CLANG_WARN_CONSTANT_CONVERSION = YES; 504 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 505 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 506 | CLANG_WARN_EMPTY_BODY = YES; 507 | CLANG_WARN_ENUM_CONVERSION = YES; 508 | CLANG_WARN_INFINITE_RECURSION = YES; 509 | CLANG_WARN_INT_CONVERSION = YES; 510 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 511 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 512 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 513 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 514 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 515 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 516 | CLANG_WARN_STRICT_PROTOTYPES = YES; 517 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 518 | CLANG_WARN_UNREACHABLE_CODE = YES; 519 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 520 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 521 | COPY_PHASE_STRIP = NO; 522 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 523 | ENABLE_NS_ASSERTIONS = NO; 524 | ENABLE_STRICT_OBJC_MSGSEND = YES; 525 | GCC_C_LANGUAGE_STANDARD = gnu99; 526 | GCC_NO_COMMON_BLOCKS = YES; 527 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 528 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 529 | GCC_WARN_UNDECLARED_SELECTOR = YES; 530 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 531 | GCC_WARN_UNUSED_FUNCTION = YES; 532 | GCC_WARN_UNUSED_VARIABLE = YES; 533 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 534 | MTL_ENABLE_DEBUG_INFO = NO; 535 | SDKROOT = iphoneos; 536 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 537 | VALIDATE_PRODUCT = YES; 538 | }; 539 | name = Release; 540 | }; 541 | 607FACF01AFB9204008FA782 /* Debug */ = { 542 | isa = XCBuildConfiguration; 543 | baseConfigurationReference = 7929F5F7A75146180BC214F9 /* Pods-AHDownloadButton_Example.debug.xcconfig */; 544 | buildSettings = { 545 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 546 | DEVELOPMENT_TEAM = ""; 547 | INFOPLIST_FILE = AHDownloadButton/Info.plist; 548 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 549 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 550 | MODULE_NAME = ExampleApp; 551 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 552 | PRODUCT_NAME = "$(TARGET_NAME)"; 553 | SWIFT_VERSION = 5.0; 554 | }; 555 | name = Debug; 556 | }; 557 | 607FACF11AFB9204008FA782 /* Release */ = { 558 | isa = XCBuildConfiguration; 559 | baseConfigurationReference = 023A2A6DD90614A817E77D09 /* Pods-AHDownloadButton_Example.release.xcconfig */; 560 | buildSettings = { 561 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 562 | DEVELOPMENT_TEAM = ""; 563 | INFOPLIST_FILE = AHDownloadButton/Info.plist; 564 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 565 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 566 | MODULE_NAME = ExampleApp; 567 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 568 | PRODUCT_NAME = "$(TARGET_NAME)"; 569 | SWIFT_VERSION = 5.0; 570 | }; 571 | name = Release; 572 | }; 573 | 607FACF31AFB9204008FA782 /* Debug */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = F872A62AE582B051C2615CDA /* Pods-AHDownloadButton_Tests.debug.xcconfig */; 576 | buildSettings = { 577 | CLANG_ENABLE_MODULES = YES; 578 | DEVELOPMENT_TEAM = ""; 579 | GCC_PREPROCESSOR_DEFINITIONS = ( 580 | "DEBUG=1", 581 | "$(inherited)", 582 | ); 583 | INFOPLIST_FILE = Tests/Info.plist; 584 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 585 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 588 | SWIFT_VERSION = 5.0; 589 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AHDownloadButton_Example.app/AHDownloadButton_Example"; 590 | }; 591 | name = Debug; 592 | }; 593 | 607FACF41AFB9204008FA782 /* Release */ = { 594 | isa = XCBuildConfiguration; 595 | baseConfigurationReference = D30B8FFC1198B90747524EB6 /* Pods-AHDownloadButton_Tests.release.xcconfig */; 596 | buildSettings = { 597 | CLANG_ENABLE_MODULES = YES; 598 | DEVELOPMENT_TEAM = ""; 599 | INFOPLIST_FILE = Tests/Info.plist; 600 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 601 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | SWIFT_VERSION = 5.0; 604 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AHDownloadButton_Example.app/AHDownloadButton_Example"; 605 | }; 606 | name = Release; 607 | }; 608 | /* End XCBuildConfiguration section */ 609 | 610 | /* Begin XCConfigurationList section */ 611 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "AHDownloadButton" */ = { 612 | isa = XCConfigurationList; 613 | buildConfigurations = ( 614 | 607FACED1AFB9204008FA782 /* Debug */, 615 | 607FACEE1AFB9204008FA782 /* Release */, 616 | ); 617 | defaultConfigurationIsVisible = 0; 618 | defaultConfigurationName = Release; 619 | }; 620 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AHDownloadButton_Example" */ = { 621 | isa = XCConfigurationList; 622 | buildConfigurations = ( 623 | 607FACF01AFB9204008FA782 /* Debug */, 624 | 607FACF11AFB9204008FA782 /* Release */, 625 | ); 626 | defaultConfigurationIsVisible = 0; 627 | defaultConfigurationName = Release; 628 | }; 629 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AHDownloadButton_Tests" */ = { 630 | isa = XCConfigurationList; 631 | buildConfigurations = ( 632 | 607FACF31AFB9204008FA782 /* Debug */, 633 | 607FACF41AFB9204008FA782 /* Release */, 634 | ); 635 | defaultConfigurationIsVisible = 0; 636 | defaultConfigurationName = Release; 637 | }; 638 | /* End XCConfigurationList section */ 639 | }; 640 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 641 | } 642 | -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcodeproj/xcshareddata/xcschemes/AHDownloadButton-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 76 | 78 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/AHDownloadButton.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Latest 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/AHDownloadButton/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukić on 09/09/2018. 6 | // Copyright (c) 2018 Amer Hukić. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | window = UIWindow(frame: UIScreen.main.bounds) 18 | window?.makeKeyAndVisible() 19 | window?.rootViewController = DownloadViewController() 20 | return true 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Example/AHDownloadButton/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Example/AHDownloadButton/DownloadViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadViewController.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukić on 09/09/2018. 6 | // Copyright (c) 2018 Amer Hukić. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AHDownloadButton 11 | 12 | class DownloadViewController: UIViewController { 13 | 14 | let downloadButton = AHDownloadButton() 15 | var downloadTimer: Timer? 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | view.backgroundColor = .white 20 | 21 | let width: CGFloat = 450 22 | let size = CGSize(width: width, height: width / 5) 23 | let origin = CGPoint(x: view.center.x - size.width / 2, y: view.center.y - size.height / 2) 24 | downloadButton.frame = CGRect(origin: origin, size: size) 25 | view.addSubview(downloadButton) 26 | 27 | downloadButton.delegate = self 28 | downloadButton.startDownloadButtonTitle = "DOWNLOAD" 29 | downloadButton.startDownloadButtonTitleFont = UIFont.boldSystemFont(ofSize: 35) 30 | downloadButton.startDownloadButtonTitleSidePadding = 40 31 | 32 | downloadButton.pendingCircleLineWidth = 5 33 | downloadButton.downloadingButtonCircleLineWidth = 5 34 | 35 | downloadButton.downloadedButtonTitle = "OPEN" 36 | downloadButton.downloadedButtonTitleFont = UIFont.boldSystemFont(ofSize: 35) 37 | downloadButton.downloadedButtonTitleSidePadding = 40 38 | 39 | } 40 | 41 | func simulateDownloading() { 42 | downloadTimer = Timer.scheduledTimer(withTimeInterval: 0.2, repeats: true) { timer in 43 | guard self.downloadButton.progress < 1 else { 44 | self.downloadButton.state = .downloaded 45 | timer.invalidate() 46 | return 47 | } 48 | self.downloadButton.progress += CGFloat(timer.timeInterval/15) 49 | } 50 | downloadTimer?.fire() 51 | } 52 | 53 | } 54 | 55 | extension DownloadViewController: AHDownloadButtonDelegate { 56 | 57 | func downloadButton(_ downloadButton: AHDownloadButton, tappedWithState state: AHDownloadButton.State) { 58 | switch state { 59 | case .startDownload: 60 | downloadTimer?.invalidate() 61 | downloadButton.progress = 0 62 | downloadButton.state = .pending 63 | DispatchQueue.main.asyncAfter(deadline: .now() + 2) { 64 | self.downloadButton.state = .downloading 65 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) { 66 | self.simulateDownloading() 67 | } 68 | } 69 | case .pending: 70 | break 71 | case .downloading, .downloaded: 72 | downloadTimer?.invalidate() 73 | downloadButton.progress = 0 74 | downloadButton.state = .startDownload 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Example/AHDownloadButton/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/AHDownloadButton/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'AHDownloadButton_Example' do 4 | pod 'AHDownloadButton', :path => '../' 5 | 6 | target 'AHDownloadButton_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AHDownloadButton (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - AHDownloadButton (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AHDownloadButton: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | AHDownloadButton: ecc4690a3d6dad17d3a6460c8cbd5252c7948071 13 | 14 | PODFILE CHECKSUM: fecba5d42722f860c18eaf524c809427ca655eab 15 | 16 | COCOAPODS: 1.4.0 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/AHDownloadButton.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AHDownloadButton", 3 | "version": "1.0.0", 4 | "summary": "Customisable download button with progress animation", 5 | "description": "AHDownloadButton is a customisable download button similar to the download button in newest version of the Apple App Store app (since iOS 11).\nIt features download progress animation as well as animated transitions between download states: start download, pending, downloading and downloaded.", 6 | "homepage": "https://github.com/amerhukic/AHDownloadButton", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Amer Hukić": "hukicamer@gmail.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/amerhukic/AHDownloadButton.git", 16 | "tag": "1.0.0" 17 | }, 18 | "social_media_url": "https://twitter.com/hukicamer", 19 | "platforms": { 20 | "ios": "8.0" 21 | }, 22 | "source_files": "AHDownloadButton/Classes/**/*", 23 | "frameworks": "UIKit", 24 | "swift_version": "4.2" 25 | } 26 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AHDownloadButton (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - AHDownloadButton (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AHDownloadButton: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | AHDownloadButton: ecc4690a3d6dad17d3a6460c8cbd5252c7948071 13 | 14 | PODFILE CHECKSUM: fecba5d42722f860c18eaf524c809427ca655eab 15 | 16 | COCOAPODS: 1.4.0 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 18BD8FA6C8AB43BA926A10E2E51655AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D88AAE1F92055A60CC2FC970D7D34634 /* Foundation.framework */; }; 11 | 19225E8B268755CC003BE6D8 /* HighlightableRoundedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E82268755CB003BE6D8 /* HighlightableRoundedButton.swift */; }; 12 | 19225E8C268755CC003BE6D8 /* AHDownloadButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E83268755CB003BE6D8 /* AHDownloadButton.swift */; }; 13 | 19225E8D268755CC003BE6D8 /* ProgressButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E84268755CB003BE6D8 /* ProgressButton.swift */; }; 14 | 19225E8E268755CC003BE6D8 /* UIButton+TitleWidth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E85268755CB003BE6D8 /* UIButton+TitleWidth.swift */; }; 15 | 19225E8F268755CC003BE6D8 /* UIView+Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E86268755CC003BE6D8 /* UIView+Constraint.swift */; }; 16 | 19225E90268755CC003BE6D8 /* CircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E87268755CC003BE6D8 /* CircleView.swift */; }; 17 | 19225E91268755CC003BE6D8 /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E88268755CC003BE6D8 /* Color.swift */; }; 18 | 19225E92268755CC003BE6D8 /* AHDownloadButton+StateTransitionAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E89268755CC003BE6D8 /* AHDownloadButton+StateTransitionAnimation.swift */; }; 19 | 19225E93268755CC003BE6D8 /* ProgressCircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19225E8A268755CC003BE6D8 /* ProgressCircleView.swift */; }; 20 | 269634DCEB710BE596C7E624BC85D9AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D88AAE1F92055A60CC2FC970D7D34634 /* Foundation.framework */; }; 21 | 2A402A88FBAA27384891817A4458C469 /* AHDownloadButton-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 675A72E53B07EB916B70E51627009A83 /* AHDownloadButton-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | 410B78E1008991475882F99E94ABA74B /* Pods-AHDownloadButton_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AAD7D501D2D553782A5A036D8760172E /* Pods-AHDownloadButton_Example-dummy.m */; }; 23 | 4D0096ED5F5BF2ED9BE819E700E97197 /* AHDownloadButton-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 71320DF77201F08F2590C086B4A7EF29 /* AHDownloadButton-dummy.m */; }; 24 | 7796AD5499A20667DE861B9C15C339BC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B63C6A64CF66340668996F78DA6BB482 /* UIKit.framework */; }; 25 | 8CB9407E82529AE147083295EE4E2DB2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D88AAE1F92055A60CC2FC970D7D34634 /* Foundation.framework */; }; 26 | C4ED2A0DBBA6E2E34315BA602D20C21F /* Pods-AHDownloadButton_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D5B1439F43D86F1BD256B06A821F69E /* Pods-AHDownloadButton_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27 | CE31ABDE859F8A1F7ECB0A44C70DCCBB /* Pods-AHDownloadButton_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 001614AED7D4B3C8331378A2E602240E /* Pods-AHDownloadButton_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 28 | E418678ACE60BBD2363EAC002DAB153A /* Pods-AHDownloadButton_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FCDDAA26EECE0CA95337AF750D806F /* Pods-AHDownloadButton_Tests-dummy.m */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 56279C4D5B72B7475BC2FA70FCE0E9D3 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 5861F89810CEE384FB44FEE40E48FBC4; 37 | remoteInfo = AHDownloadButton; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 001614AED7D4B3C8331378A2E602240E /* Pods-AHDownloadButton_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-AHDownloadButton_Example-umbrella.h"; sourceTree = ""; }; 43 | 023AE4AF935E1E6700560C670DE57CE9 /* AHDownloadButton.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = AHDownloadButton.modulemap; sourceTree = ""; }; 44 | 07BA7298A48EBB23604D616C1EEFD8C3 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 10B1F7DE36E6D59FFDE34F3976D7978A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 46 | 19225E82268755CB003BE6D8 /* HighlightableRoundedButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HighlightableRoundedButton.swift; path = Sources/AHDownloadButton/Classes/HighlightableRoundedButton.swift; sourceTree = ""; }; 47 | 19225E83268755CB003BE6D8 /* AHDownloadButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AHDownloadButton.swift; path = Sources/AHDownloadButton/Classes/AHDownloadButton.swift; sourceTree = ""; }; 48 | 19225E84268755CB003BE6D8 /* ProgressButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProgressButton.swift; path = Sources/AHDownloadButton/Classes/ProgressButton.swift; sourceTree = ""; }; 49 | 19225E85268755CB003BE6D8 /* UIButton+TitleWidth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIButton+TitleWidth.swift"; path = "Sources/AHDownloadButton/Classes/UIButton+TitleWidth.swift"; sourceTree = ""; }; 50 | 19225E86268755CC003BE6D8 /* UIView+Constraint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+Constraint.swift"; path = "Sources/AHDownloadButton/Classes/UIView+Constraint.swift"; sourceTree = ""; }; 51 | 19225E87268755CC003BE6D8 /* CircleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CircleView.swift; path = Sources/AHDownloadButton/Classes/CircleView.swift; sourceTree = ""; }; 52 | 19225E88268755CC003BE6D8 /* Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Color.swift; path = Sources/AHDownloadButton/Classes/Color.swift; sourceTree = ""; }; 53 | 19225E89268755CC003BE6D8 /* AHDownloadButton+StateTransitionAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "AHDownloadButton+StateTransitionAnimation.swift"; path = "Sources/AHDownloadButton/Classes/AHDownloadButton+StateTransitionAnimation.swift"; sourceTree = ""; }; 54 | 19225E8A268755CC003BE6D8 /* ProgressCircleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProgressCircleView.swift; path = Sources/AHDownloadButton/Classes/ProgressCircleView.swift; sourceTree = ""; }; 55 | 19523442BDA46951F36DB4C86363CAB1 /* Pods-AHDownloadButton_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-AHDownloadButton_Tests-acknowledgements.plist"; sourceTree = ""; }; 56 | 31C514260F3D6E73469B9E09EA52A0F2 /* Pods-AHDownloadButton_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-AHDownloadButton_Example.modulemap"; sourceTree = ""; }; 57 | 41A93D4B342FF126BC71D5318F205E6C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 675A72E53B07EB916B70E51627009A83 /* AHDownloadButton-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AHDownloadButton-umbrella.h"; sourceTree = ""; }; 59 | 6ABBEC3E0476AE9D7C77B786BA699151 /* Pods_AHDownloadButton_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AHDownloadButton_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 7017D38F2EEFA1C894AD77A059C55953 /* AHDownloadButton.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; path = AHDownloadButton.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 61 | 71320DF77201F08F2590C086B4A7EF29 /* AHDownloadButton-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AHDownloadButton-dummy.m"; sourceTree = ""; }; 62 | 7E93A682D479ED15C6A5042E32986E2F /* Pods-AHDownloadButton_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-AHDownloadButton_Example-acknowledgements.plist"; sourceTree = ""; }; 63 | 7E9C68CE4B39ED801F5EDC74147B2B9F /* Pods-AHDownloadButton_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-AHDownloadButton_Example.debug.xcconfig"; sourceTree = ""; }; 64 | 7FD7E173BCDFFE7CA0AB9C4AEAE5757A /* Pods-AHDownloadButton_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-AHDownloadButton_Example-resources.sh"; sourceTree = ""; }; 65 | 8AC98CE36E7EF74ADA7734B2D735377F /* Pods-AHDownloadButton_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-AHDownloadButton_Example.release.xcconfig"; sourceTree = ""; }; 66 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 67 | 93FCDDAA26EECE0CA95337AF750D806F /* Pods-AHDownloadButton_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-AHDownloadButton_Tests-dummy.m"; sourceTree = ""; }; 68 | 9440CA46BA0053D75F956F52A216EF81 /* Pods-AHDownloadButton_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-AHDownloadButton_Tests-resources.sh"; sourceTree = ""; }; 69 | 950A911906B7369ECEADBD7B632A7C72 /* Pods-AHDownloadButton_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-AHDownloadButton_Example-acknowledgements.markdown"; sourceTree = ""; }; 70 | 9D5B1439F43D86F1BD256B06A821F69E /* Pods-AHDownloadButton_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-AHDownloadButton_Tests-umbrella.h"; sourceTree = ""; }; 71 | A212FFBA277FE6DDBFA55DF0D30B1F6A /* Pods-AHDownloadButton_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-AHDownloadButton_Tests.release.xcconfig"; sourceTree = ""; }; 72 | A90CBC4FF97BC9E1DB735F15F179E6BE /* Pods-AHDownloadButton_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-AHDownloadButton_Tests.modulemap"; sourceTree = ""; }; 73 | A9443ACCF0A3D39D23CE55B8F87FC0E6 /* Pods-AHDownloadButton_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-AHDownloadButton_Tests-frameworks.sh"; sourceTree = ""; }; 74 | AAD7D501D2D553782A5A036D8760172E /* Pods-AHDownloadButton_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-AHDownloadButton_Example-dummy.m"; sourceTree = ""; }; 75 | B63C6A64CF66340668996F78DA6BB482 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 76 | B9E59A98034D09129439C15B3CE2670B /* Pods-AHDownloadButton_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-AHDownloadButton_Tests-acknowledgements.markdown"; sourceTree = ""; }; 77 | BD58D99CE6BE47DCAE72D95157BF2472 /* AHDownloadButton-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AHDownloadButton-prefix.pch"; sourceTree = ""; }; 78 | BFDFEC92EAC1F192D0BB356D40CAA710 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | C7A92EBD46D262955E0C4FD3D2821E2B /* AHDownloadButton.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AHDownloadButton.xcconfig; sourceTree = ""; }; 80 | CDBF91FB34AF748A17E31A368D752439 /* Pods_AHDownloadButton_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AHDownloadButton_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | CF6A10698CE92ED3E5A522FC3AF03AF8 /* Pods-AHDownloadButton_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-AHDownloadButton_Tests.debug.xcconfig"; sourceTree = ""; }; 82 | D88AAE1F92055A60CC2FC970D7D34634 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 83 | D9D13C3522FF7A20B22D4CA2984467E5 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 84 | E125BDFA66675FBCE9C4C359507FC556 /* Pods-AHDownloadButton_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-AHDownloadButton_Example-frameworks.sh"; sourceTree = ""; }; 85 | F93A37AFBF0D2E0686DF74E818A006AB /* AHDownloadButton.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AHDownloadButton.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 86 | /* End PBXFileReference section */ 87 | 88 | /* Begin PBXFrameworksBuildPhase section */ 89 | 6CBA0EB04687224AEFD4B6A7B0BAB5B3 /* Frameworks */ = { 90 | isa = PBXFrameworksBuildPhase; 91 | buildActionMask = 2147483647; 92 | files = ( 93 | 8CB9407E82529AE147083295EE4E2DB2 /* Foundation.framework in Frameworks */, 94 | 7796AD5499A20667DE861B9C15C339BC /* UIKit.framework in Frameworks */, 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | F8284C8CD9AE6D556C5F86855A77D7D7 /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | 18BD8FA6C8AB43BA926A10E2E51655AC /* Foundation.framework in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | F8B08EEE6596FBA95ED50CAE71CA7D52 /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | 269634DCEB710BE596C7E624BC85D9AE /* Foundation.framework in Frameworks */, 111 | ); 112 | runOnlyForDeploymentPostprocessing = 0; 113 | }; 114 | /* End PBXFrameworksBuildPhase section */ 115 | 116 | /* Begin PBXGroup section */ 117 | 123FB98CF02D6160388F5E7EEA61EDA0 /* Support Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 023AE4AF935E1E6700560C670DE57CE9 /* AHDownloadButton.modulemap */, 121 | C7A92EBD46D262955E0C4FD3D2821E2B /* AHDownloadButton.xcconfig */, 122 | 71320DF77201F08F2590C086B4A7EF29 /* AHDownloadButton-dummy.m */, 123 | BD58D99CE6BE47DCAE72D95157BF2472 /* AHDownloadButton-prefix.pch */, 124 | 675A72E53B07EB916B70E51627009A83 /* AHDownloadButton-umbrella.h */, 125 | 41A93D4B342FF126BC71D5318F205E6C /* Info.plist */, 126 | ); 127 | name = "Support Files"; 128 | path = "Example/Pods/Target Support Files/AHDownloadButton"; 129 | sourceTree = ""; 130 | }; 131 | 433CD3331B6C3787F473C941B61FC68F /* Frameworks */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 438B396F6B4147076630CAEFE34282C1 /* iOS */, 135 | ); 136 | name = Frameworks; 137 | sourceTree = ""; 138 | }; 139 | 438B396F6B4147076630CAEFE34282C1 /* iOS */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | D88AAE1F92055A60CC2FC970D7D34634 /* Foundation.framework */, 143 | B63C6A64CF66340668996F78DA6BB482 /* UIKit.framework */, 144 | ); 145 | name = iOS; 146 | sourceTree = ""; 147 | }; 148 | 504720D926EF2D109B4D778BD99EE3C5 /* Products */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | F93A37AFBF0D2E0686DF74E818A006AB /* AHDownloadButton.framework */, 152 | CDBF91FB34AF748A17E31A368D752439 /* Pods_AHDownloadButton_Example.framework */, 153 | 6ABBEC3E0476AE9D7C77B786BA699151 /* Pods_AHDownloadButton_Tests.framework */, 154 | ); 155 | name = Products; 156 | sourceTree = ""; 157 | }; 158 | 5613354F9E9F893B7CC58B416B346155 /* Pods-AHDownloadButton_Example */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 07BA7298A48EBB23604D616C1EEFD8C3 /* Info.plist */, 162 | 31C514260F3D6E73469B9E09EA52A0F2 /* Pods-AHDownloadButton_Example.modulemap */, 163 | 950A911906B7369ECEADBD7B632A7C72 /* Pods-AHDownloadButton_Example-acknowledgements.markdown */, 164 | 7E93A682D479ED15C6A5042E32986E2F /* Pods-AHDownloadButton_Example-acknowledgements.plist */, 165 | AAD7D501D2D553782A5A036D8760172E /* Pods-AHDownloadButton_Example-dummy.m */, 166 | E125BDFA66675FBCE9C4C359507FC556 /* Pods-AHDownloadButton_Example-frameworks.sh */, 167 | 7FD7E173BCDFFE7CA0AB9C4AEAE5757A /* Pods-AHDownloadButton_Example-resources.sh */, 168 | 001614AED7D4B3C8331378A2E602240E /* Pods-AHDownloadButton_Example-umbrella.h */, 169 | 7E9C68CE4B39ED801F5EDC74147B2B9F /* Pods-AHDownloadButton_Example.debug.xcconfig */, 170 | 8AC98CE36E7EF74ADA7734B2D735377F /* Pods-AHDownloadButton_Example.release.xcconfig */, 171 | ); 172 | name = "Pods-AHDownloadButton_Example"; 173 | path = "Target Support Files/Pods-AHDownloadButton_Example"; 174 | sourceTree = ""; 175 | }; 176 | 59A771AA91B3A24907B6ABE92E1A579F /* Targets Support Files */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | 5613354F9E9F893B7CC58B416B346155 /* Pods-AHDownloadButton_Example */, 180 | 79226947624046C64112C916CC458761 /* Pods-AHDownloadButton_Tests */, 181 | ); 182 | name = "Targets Support Files"; 183 | sourceTree = ""; 184 | }; 185 | 72C964AFC27B32657983DFADE242214A /* AHDownloadButton */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 19225E83268755CB003BE6D8 /* AHDownloadButton.swift */, 189 | 19225E89268755CC003BE6D8 /* AHDownloadButton+StateTransitionAnimation.swift */, 190 | 19225E87268755CC003BE6D8 /* CircleView.swift */, 191 | 19225E88268755CC003BE6D8 /* Color.swift */, 192 | 19225E82268755CB003BE6D8 /* HighlightableRoundedButton.swift */, 193 | 19225E84268755CB003BE6D8 /* ProgressButton.swift */, 194 | 19225E8A268755CC003BE6D8 /* ProgressCircleView.swift */, 195 | 19225E85268755CB003BE6D8 /* UIButton+TitleWidth.swift */, 196 | 19225E86268755CC003BE6D8 /* UIView+Constraint.swift */, 197 | EF195ED335C0AAD71E047DC0882E49C6 /* Pod */, 198 | 123FB98CF02D6160388F5E7EEA61EDA0 /* Support Files */, 199 | ); 200 | name = AHDownloadButton; 201 | path = ../..; 202 | sourceTree = ""; 203 | }; 204 | 79226947624046C64112C916CC458761 /* Pods-AHDownloadButton_Tests */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | BFDFEC92EAC1F192D0BB356D40CAA710 /* Info.plist */, 208 | A90CBC4FF97BC9E1DB735F15F179E6BE /* Pods-AHDownloadButton_Tests.modulemap */, 209 | B9E59A98034D09129439C15B3CE2670B /* Pods-AHDownloadButton_Tests-acknowledgements.markdown */, 210 | 19523442BDA46951F36DB4C86363CAB1 /* Pods-AHDownloadButton_Tests-acknowledgements.plist */, 211 | 93FCDDAA26EECE0CA95337AF750D806F /* Pods-AHDownloadButton_Tests-dummy.m */, 212 | A9443ACCF0A3D39D23CE55B8F87FC0E6 /* Pods-AHDownloadButton_Tests-frameworks.sh */, 213 | 9440CA46BA0053D75F956F52A216EF81 /* Pods-AHDownloadButton_Tests-resources.sh */, 214 | 9D5B1439F43D86F1BD256B06A821F69E /* Pods-AHDownloadButton_Tests-umbrella.h */, 215 | CF6A10698CE92ED3E5A522FC3AF03AF8 /* Pods-AHDownloadButton_Tests.debug.xcconfig */, 216 | A212FFBA277FE6DDBFA55DF0D30B1F6A /* Pods-AHDownloadButton_Tests.release.xcconfig */, 217 | ); 218 | name = "Pods-AHDownloadButton_Tests"; 219 | path = "Target Support Files/Pods-AHDownloadButton_Tests"; 220 | sourceTree = ""; 221 | }; 222 | 7DB346D0F39D3F0E887471402A8071AB = { 223 | isa = PBXGroup; 224 | children = ( 225 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 226 | F289C361EE0BF342ACE38C6F67451891 /* Development Pods */, 227 | 433CD3331B6C3787F473C941B61FC68F /* Frameworks */, 228 | 504720D926EF2D109B4D778BD99EE3C5 /* Products */, 229 | 59A771AA91B3A24907B6ABE92E1A579F /* Targets Support Files */, 230 | ); 231 | sourceTree = ""; 232 | }; 233 | EF195ED335C0AAD71E047DC0882E49C6 /* Pod */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 7017D38F2EEFA1C894AD77A059C55953 /* AHDownloadButton.podspec */, 237 | D9D13C3522FF7A20B22D4CA2984467E5 /* LICENSE */, 238 | 10B1F7DE36E6D59FFDE34F3976D7978A /* README.md */, 239 | ); 240 | name = Pod; 241 | sourceTree = ""; 242 | }; 243 | F289C361EE0BF342ACE38C6F67451891 /* Development Pods */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | 72C964AFC27B32657983DFADE242214A /* AHDownloadButton */, 247 | ); 248 | name = "Development Pods"; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXGroup section */ 252 | 253 | /* Begin PBXHeadersBuildPhase section */ 254 | 1444FB6663975BDF1B7EB72FC1DBBC2C /* Headers */ = { 255 | isa = PBXHeadersBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 2A402A88FBAA27384891817A4458C469 /* AHDownloadButton-umbrella.h in Headers */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | 321B3AE6616FD437E510649950501C94 /* Headers */ = { 263 | isa = PBXHeadersBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | C4ED2A0DBBA6E2E34315BA602D20C21F /* Pods-AHDownloadButton_Tests-umbrella.h in Headers */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | 4466B79A07B573FFA9A1291BCFEF7A26 /* Headers */ = { 271 | isa = PBXHeadersBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | CE31ABDE859F8A1F7ECB0A44C70DCCBB /* Pods-AHDownloadButton_Example-umbrella.h in Headers */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | /* End PBXHeadersBuildPhase section */ 279 | 280 | /* Begin PBXNativeTarget section */ 281 | 50E41F21AC100C8E1564DDBD0C3CF22D /* Pods-AHDownloadButton_Example */ = { 282 | isa = PBXNativeTarget; 283 | buildConfigurationList = 802A19775C2F58BD7139B313E1603049 /* Build configuration list for PBXNativeTarget "Pods-AHDownloadButton_Example" */; 284 | buildPhases = ( 285 | C8A2DCD29B70B6E54F5568D607F2D3EA /* Sources */, 286 | F8B08EEE6596FBA95ED50CAE71CA7D52 /* Frameworks */, 287 | 4466B79A07B573FFA9A1291BCFEF7A26 /* Headers */, 288 | ); 289 | buildRules = ( 290 | ); 291 | dependencies = ( 292 | 273EE635DD116181FBF16EF5B320E3BD /* PBXTargetDependency */, 293 | ); 294 | name = "Pods-AHDownloadButton_Example"; 295 | productName = "Pods-AHDownloadButton_Example"; 296 | productReference = CDBF91FB34AF748A17E31A368D752439 /* Pods_AHDownloadButton_Example.framework */; 297 | productType = "com.apple.product-type.framework"; 298 | }; 299 | 5861F89810CEE384FB44FEE40E48FBC4 /* AHDownloadButton */ = { 300 | isa = PBXNativeTarget; 301 | buildConfigurationList = 0A8F46537D9244AE0A609E2A1F247F8A /* Build configuration list for PBXNativeTarget "AHDownloadButton" */; 302 | buildPhases = ( 303 | 3C913BEA27530CAA3364C277D650DF75 /* Sources */, 304 | 6CBA0EB04687224AEFD4B6A7B0BAB5B3 /* Frameworks */, 305 | 1444FB6663975BDF1B7EB72FC1DBBC2C /* Headers */, 306 | ); 307 | buildRules = ( 308 | ); 309 | dependencies = ( 310 | ); 311 | name = AHDownloadButton; 312 | productName = AHDownloadButton; 313 | productReference = F93A37AFBF0D2E0686DF74E818A006AB /* AHDownloadButton.framework */; 314 | productType = "com.apple.product-type.framework"; 315 | }; 316 | 9246C61CD94CAA0D0D1FD24A8CAFC79E /* Pods-AHDownloadButton_Tests */ = { 317 | isa = PBXNativeTarget; 318 | buildConfigurationList = 17354003706CADA2BC88186394F82C7B /* Build configuration list for PBXNativeTarget "Pods-AHDownloadButton_Tests" */; 319 | buildPhases = ( 320 | 929C61229DC446EE245798470836E3A0 /* Sources */, 321 | F8284C8CD9AE6D556C5F86855A77D7D7 /* Frameworks */, 322 | 321B3AE6616FD437E510649950501C94 /* Headers */, 323 | ); 324 | buildRules = ( 325 | ); 326 | dependencies = ( 327 | ); 328 | name = "Pods-AHDownloadButton_Tests"; 329 | productName = "Pods-AHDownloadButton_Tests"; 330 | productReference = 6ABBEC3E0476AE9D7C77B786BA699151 /* Pods_AHDownloadButton_Tests.framework */; 331 | productType = "com.apple.product-type.framework"; 332 | }; 333 | /* End PBXNativeTarget section */ 334 | 335 | /* Begin PBXProject section */ 336 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 337 | isa = PBXProject; 338 | attributes = { 339 | LastSwiftUpdateCheck = 0930; 340 | LastUpgradeCheck = 1220; 341 | TargetAttributes = { 342 | 5861F89810CEE384FB44FEE40E48FBC4 = { 343 | LastSwiftMigration = 1250; 344 | }; 345 | }; 346 | }; 347 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 348 | compatibilityVersion = "Xcode 3.2"; 349 | developmentRegion = en; 350 | hasScannedForEncodings = 0; 351 | knownRegions = ( 352 | en, 353 | Base, 354 | ); 355 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 356 | productRefGroup = 504720D926EF2D109B4D778BD99EE3C5 /* Products */; 357 | projectDirPath = ""; 358 | projectRoot = ""; 359 | targets = ( 360 | 5861F89810CEE384FB44FEE40E48FBC4 /* AHDownloadButton */, 361 | 50E41F21AC100C8E1564DDBD0C3CF22D /* Pods-AHDownloadButton_Example */, 362 | 9246C61CD94CAA0D0D1FD24A8CAFC79E /* Pods-AHDownloadButton_Tests */, 363 | ); 364 | }; 365 | /* End PBXProject section */ 366 | 367 | /* Begin PBXSourcesBuildPhase section */ 368 | 3C913BEA27530CAA3364C277D650DF75 /* Sources */ = { 369 | isa = PBXSourcesBuildPhase; 370 | buildActionMask = 2147483647; 371 | files = ( 372 | 19225E8E268755CC003BE6D8 /* UIButton+TitleWidth.swift in Sources */, 373 | 19225E93268755CC003BE6D8 /* ProgressCircleView.swift in Sources */, 374 | 19225E8D268755CC003BE6D8 /* ProgressButton.swift in Sources */, 375 | 19225E8C268755CC003BE6D8 /* AHDownloadButton.swift in Sources */, 376 | 19225E8F268755CC003BE6D8 /* UIView+Constraint.swift in Sources */, 377 | 19225E8B268755CC003BE6D8 /* HighlightableRoundedButton.swift in Sources */, 378 | 19225E92268755CC003BE6D8 /* AHDownloadButton+StateTransitionAnimation.swift in Sources */, 379 | 19225E91268755CC003BE6D8 /* Color.swift in Sources */, 380 | 19225E90268755CC003BE6D8 /* CircleView.swift in Sources */, 381 | 4D0096ED5F5BF2ED9BE819E700E97197 /* AHDownloadButton-dummy.m in Sources */, 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | 929C61229DC446EE245798470836E3A0 /* Sources */ = { 386 | isa = PBXSourcesBuildPhase; 387 | buildActionMask = 2147483647; 388 | files = ( 389 | E418678ACE60BBD2363EAC002DAB153A /* Pods-AHDownloadButton_Tests-dummy.m in Sources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | C8A2DCD29B70B6E54F5568D607F2D3EA /* Sources */ = { 394 | isa = PBXSourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | 410B78E1008991475882F99E94ABA74B /* Pods-AHDownloadButton_Example-dummy.m in Sources */, 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | /* End PBXSourcesBuildPhase section */ 402 | 403 | /* Begin PBXTargetDependency section */ 404 | 273EE635DD116181FBF16EF5B320E3BD /* PBXTargetDependency */ = { 405 | isa = PBXTargetDependency; 406 | name = AHDownloadButton; 407 | target = 5861F89810CEE384FB44FEE40E48FBC4 /* AHDownloadButton */; 408 | targetProxy = 56279C4D5B72B7475BC2FA70FCE0E9D3 /* PBXContainerItemProxy */; 409 | }; 410 | /* End PBXTargetDependency section */ 411 | 412 | /* Begin XCBuildConfiguration section */ 413 | 1802BB7D7D0B4B5FB90DBB94C25EE9BF /* Release */ = { 414 | isa = XCBuildConfiguration; 415 | baseConfigurationReference = C7A92EBD46D262955E0C4FD3D2821E2B /* AHDownloadButton.xcconfig */; 416 | buildSettings = { 417 | CLANG_ENABLE_MODULES = YES; 418 | CODE_SIGN_IDENTITY = ""; 419 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 421 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 422 | CURRENT_PROJECT_VERSION = 1; 423 | DEFINES_MODULE = YES; 424 | DYLIB_COMPATIBILITY_VERSION = 1; 425 | DYLIB_CURRENT_VERSION = 1; 426 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 427 | GCC_PREFIX_HEADER = "Target Support Files/AHDownloadButton/AHDownloadButton-prefix.pch"; 428 | INFOPLIST_FILE = "Target Support Files/AHDownloadButton/Info.plist"; 429 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 430 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 432 | MODULEMAP_FILE = "Target Support Files/AHDownloadButton/AHDownloadButton.modulemap"; 433 | PRODUCT_NAME = AHDownloadButton; 434 | SDKROOT = iphoneos; 435 | SKIP_INSTALL = YES; 436 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 438 | SWIFT_VERSION = 5.0; 439 | TARGETED_DEVICE_FAMILY = "1,2"; 440 | VALIDATE_PRODUCT = YES; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | VERSION_INFO_PREFIX = ""; 443 | }; 444 | name = Release; 445 | }; 446 | 5011B865762FC0C0A28ECEC4CB63DC68 /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | buildSettings = { 449 | ALWAYS_SEARCH_USER_PATHS = NO; 450 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 451 | CLANG_ANALYZER_NONNULL = YES; 452 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 453 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 454 | CLANG_CXX_LIBRARY = "libc++"; 455 | CLANG_ENABLE_MODULES = YES; 456 | CLANG_ENABLE_OBJC_ARC = YES; 457 | CLANG_ENABLE_OBJC_WEAK = YES; 458 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 459 | CLANG_WARN_BOOL_CONVERSION = YES; 460 | CLANG_WARN_COMMA = YES; 461 | CLANG_WARN_CONSTANT_CONVERSION = YES; 462 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 465 | CLANG_WARN_EMPTY_BODY = YES; 466 | CLANG_WARN_ENUM_CONVERSION = YES; 467 | CLANG_WARN_INFINITE_RECURSION = YES; 468 | CLANG_WARN_INT_CONVERSION = YES; 469 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 470 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 471 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 472 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 473 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 474 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 475 | CLANG_WARN_STRICT_PROTOTYPES = YES; 476 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 477 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 478 | CLANG_WARN_UNREACHABLE_CODE = YES; 479 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 480 | CODE_SIGNING_REQUIRED = NO; 481 | COPY_PHASE_STRIP = NO; 482 | DEBUG_INFORMATION_FORMAT = dwarf; 483 | ENABLE_STRICT_OBJC_MSGSEND = YES; 484 | ENABLE_TESTABILITY = YES; 485 | GCC_C_LANGUAGE_STANDARD = gnu11; 486 | GCC_DYNAMIC_NO_PIC = NO; 487 | GCC_NO_COMMON_BLOCKS = YES; 488 | GCC_OPTIMIZATION_LEVEL = 0; 489 | GCC_PREPROCESSOR_DEFINITIONS = ( 490 | "POD_CONFIGURATION_DEBUG=1", 491 | "DEBUG=1", 492 | "$(inherited)", 493 | ); 494 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 495 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 496 | GCC_WARN_UNDECLARED_SELECTOR = YES; 497 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 498 | GCC_WARN_UNUSED_FUNCTION = YES; 499 | GCC_WARN_UNUSED_VARIABLE = YES; 500 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 501 | MTL_ENABLE_DEBUG_INFO = YES; 502 | ONLY_ACTIVE_ARCH = YES; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 505 | STRIP_INSTALLED_PRODUCT = NO; 506 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 507 | SYMROOT = "${SRCROOT}/../build"; 508 | }; 509 | name = Debug; 510 | }; 511 | 649CE1ADE1A7F444DF58021667FEF568 /* Debug */ = { 512 | isa = XCBuildConfiguration; 513 | baseConfigurationReference = C7A92EBD46D262955E0C4FD3D2821E2B /* AHDownloadButton.xcconfig */; 514 | buildSettings = { 515 | CLANG_ENABLE_MODULES = YES; 516 | CODE_SIGN_IDENTITY = ""; 517 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 518 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 519 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 520 | CURRENT_PROJECT_VERSION = 1; 521 | DEFINES_MODULE = YES; 522 | DYLIB_COMPATIBILITY_VERSION = 1; 523 | DYLIB_CURRENT_VERSION = 1; 524 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 525 | GCC_PREFIX_HEADER = "Target Support Files/AHDownloadButton/AHDownloadButton-prefix.pch"; 526 | INFOPLIST_FILE = "Target Support Files/AHDownloadButton/Info.plist"; 527 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 528 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 529 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 530 | MODULEMAP_FILE = "Target Support Files/AHDownloadButton/AHDownloadButton.modulemap"; 531 | PRODUCT_NAME = AHDownloadButton; 532 | SDKROOT = iphoneos; 533 | SKIP_INSTALL = YES; 534 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 535 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 536 | SWIFT_VERSION = 5.0; 537 | TARGETED_DEVICE_FAMILY = "1,2"; 538 | VERSIONING_SYSTEM = "apple-generic"; 539 | VERSION_INFO_PREFIX = ""; 540 | }; 541 | name = Debug; 542 | }; 543 | 826BC7A2EB2126BC25A9C32FF4E3EDEB /* Release */ = { 544 | isa = XCBuildConfiguration; 545 | baseConfigurationReference = 8AC98CE36E7EF74ADA7734B2D735377F /* Pods-AHDownloadButton_Example.release.xcconfig */; 546 | buildSettings = { 547 | CODE_SIGN_IDENTITY = ""; 548 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 549 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 550 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 551 | CURRENT_PROJECT_VERSION = 1; 552 | DEFINES_MODULE = YES; 553 | DYLIB_COMPATIBILITY_VERSION = 1; 554 | DYLIB_CURRENT_VERSION = 1; 555 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 556 | INFOPLIST_FILE = "Target Support Files/Pods-AHDownloadButton_Example/Info.plist"; 557 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 558 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 559 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 560 | MACH_O_TYPE = staticlib; 561 | MODULEMAP_FILE = "Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.modulemap"; 562 | OTHER_LDFLAGS = ""; 563 | OTHER_LIBTOOLFLAGS = ""; 564 | PODS_ROOT = "$(SRCROOT)"; 565 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 566 | PRODUCT_NAME = Pods_AHDownloadButton_Example; 567 | SDKROOT = iphoneos; 568 | SKIP_INSTALL = YES; 569 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 570 | TARGETED_DEVICE_FAMILY = "1,2"; 571 | VALIDATE_PRODUCT = YES; 572 | VERSIONING_SYSTEM = "apple-generic"; 573 | VERSION_INFO_PREFIX = ""; 574 | }; 575 | name = Release; 576 | }; 577 | 827269710C98D60C14D46BC6AF9BF728 /* Release */ = { 578 | isa = XCBuildConfiguration; 579 | buildSettings = { 580 | ALWAYS_SEARCH_USER_PATHS = NO; 581 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 582 | CLANG_ANALYZER_NONNULL = YES; 583 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 584 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 585 | CLANG_CXX_LIBRARY = "libc++"; 586 | CLANG_ENABLE_MODULES = YES; 587 | CLANG_ENABLE_OBJC_ARC = YES; 588 | CLANG_ENABLE_OBJC_WEAK = YES; 589 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 590 | CLANG_WARN_BOOL_CONVERSION = YES; 591 | CLANG_WARN_COMMA = YES; 592 | CLANG_WARN_CONSTANT_CONVERSION = YES; 593 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 594 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 595 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 596 | CLANG_WARN_EMPTY_BODY = YES; 597 | CLANG_WARN_ENUM_CONVERSION = YES; 598 | CLANG_WARN_INFINITE_RECURSION = YES; 599 | CLANG_WARN_INT_CONVERSION = YES; 600 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 601 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 602 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 603 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 604 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 605 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 606 | CLANG_WARN_STRICT_PROTOTYPES = YES; 607 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 608 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 609 | CLANG_WARN_UNREACHABLE_CODE = YES; 610 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 611 | CODE_SIGNING_REQUIRED = NO; 612 | COPY_PHASE_STRIP = NO; 613 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 614 | ENABLE_NS_ASSERTIONS = NO; 615 | ENABLE_STRICT_OBJC_MSGSEND = YES; 616 | GCC_C_LANGUAGE_STANDARD = gnu11; 617 | GCC_NO_COMMON_BLOCKS = YES; 618 | GCC_PREPROCESSOR_DEFINITIONS = ( 619 | "POD_CONFIGURATION_RELEASE=1", 620 | "$(inherited)", 621 | ); 622 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 623 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 624 | GCC_WARN_UNDECLARED_SELECTOR = YES; 625 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 626 | GCC_WARN_UNUSED_FUNCTION = YES; 627 | GCC_WARN_UNUSED_VARIABLE = YES; 628 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 629 | MTL_ENABLE_DEBUG_INFO = NO; 630 | PRODUCT_NAME = "$(TARGET_NAME)"; 631 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 632 | STRIP_INSTALLED_PRODUCT = NO; 633 | SWIFT_COMPILATION_MODE = wholemodule; 634 | SYMROOT = "${SRCROOT}/../build"; 635 | }; 636 | name = Release; 637 | }; 638 | 99C40C91D584530A758F189296374BA3 /* Debug */ = { 639 | isa = XCBuildConfiguration; 640 | baseConfigurationReference = 7E9C68CE4B39ED801F5EDC74147B2B9F /* Pods-AHDownloadButton_Example.debug.xcconfig */; 641 | buildSettings = { 642 | CODE_SIGN_IDENTITY = ""; 643 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 644 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 645 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 646 | CURRENT_PROJECT_VERSION = 1; 647 | DEFINES_MODULE = YES; 648 | DYLIB_COMPATIBILITY_VERSION = 1; 649 | DYLIB_CURRENT_VERSION = 1; 650 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 651 | INFOPLIST_FILE = "Target Support Files/Pods-AHDownloadButton_Example/Info.plist"; 652 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 653 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 654 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 655 | MACH_O_TYPE = staticlib; 656 | MODULEMAP_FILE = "Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.modulemap"; 657 | OTHER_LDFLAGS = ""; 658 | OTHER_LIBTOOLFLAGS = ""; 659 | PODS_ROOT = "$(SRCROOT)"; 660 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 661 | PRODUCT_NAME = Pods_AHDownloadButton_Example; 662 | SDKROOT = iphoneos; 663 | SKIP_INSTALL = YES; 664 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 665 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 666 | TARGETED_DEVICE_FAMILY = "1,2"; 667 | VERSIONING_SYSTEM = "apple-generic"; 668 | VERSION_INFO_PREFIX = ""; 669 | }; 670 | name = Debug; 671 | }; 672 | A6B6157A7C2B08D3A3986F3F5EAF5FFD /* Debug */ = { 673 | isa = XCBuildConfiguration; 674 | baseConfigurationReference = CF6A10698CE92ED3E5A522FC3AF03AF8 /* Pods-AHDownloadButton_Tests.debug.xcconfig */; 675 | buildSettings = { 676 | CODE_SIGN_IDENTITY = ""; 677 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 678 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 679 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 680 | CURRENT_PROJECT_VERSION = 1; 681 | DEFINES_MODULE = YES; 682 | DYLIB_COMPATIBILITY_VERSION = 1; 683 | DYLIB_CURRENT_VERSION = 1; 684 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 685 | INFOPLIST_FILE = "Target Support Files/Pods-AHDownloadButton_Tests/Info.plist"; 686 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 687 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 688 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 689 | MACH_O_TYPE = staticlib; 690 | MODULEMAP_FILE = "Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.modulemap"; 691 | OTHER_LDFLAGS = ""; 692 | OTHER_LIBTOOLFLAGS = ""; 693 | PODS_ROOT = "$(SRCROOT)"; 694 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 695 | PRODUCT_NAME = Pods_AHDownloadButton_Tests; 696 | SDKROOT = iphoneos; 697 | SKIP_INSTALL = YES; 698 | TARGETED_DEVICE_FAMILY = "1,2"; 699 | VERSIONING_SYSTEM = "apple-generic"; 700 | VERSION_INFO_PREFIX = ""; 701 | }; 702 | name = Debug; 703 | }; 704 | B7D486BEBF661A31DF9B834AA3B625C1 /* Release */ = { 705 | isa = XCBuildConfiguration; 706 | baseConfigurationReference = A212FFBA277FE6DDBFA55DF0D30B1F6A /* Pods-AHDownloadButton_Tests.release.xcconfig */; 707 | buildSettings = { 708 | CODE_SIGN_IDENTITY = ""; 709 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 710 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 711 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 712 | CURRENT_PROJECT_VERSION = 1; 713 | DEFINES_MODULE = YES; 714 | DYLIB_COMPATIBILITY_VERSION = 1; 715 | DYLIB_CURRENT_VERSION = 1; 716 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 717 | INFOPLIST_FILE = "Target Support Files/Pods-AHDownloadButton_Tests/Info.plist"; 718 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 719 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 720 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 721 | MACH_O_TYPE = staticlib; 722 | MODULEMAP_FILE = "Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.modulemap"; 723 | OTHER_LDFLAGS = ""; 724 | OTHER_LIBTOOLFLAGS = ""; 725 | PODS_ROOT = "$(SRCROOT)"; 726 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 727 | PRODUCT_NAME = Pods_AHDownloadButton_Tests; 728 | SDKROOT = iphoneos; 729 | SKIP_INSTALL = YES; 730 | TARGETED_DEVICE_FAMILY = "1,2"; 731 | VALIDATE_PRODUCT = YES; 732 | VERSIONING_SYSTEM = "apple-generic"; 733 | VERSION_INFO_PREFIX = ""; 734 | }; 735 | name = Release; 736 | }; 737 | /* End XCBuildConfiguration section */ 738 | 739 | /* Begin XCConfigurationList section */ 740 | 0A8F46537D9244AE0A609E2A1F247F8A /* Build configuration list for PBXNativeTarget "AHDownloadButton" */ = { 741 | isa = XCConfigurationList; 742 | buildConfigurations = ( 743 | 649CE1ADE1A7F444DF58021667FEF568 /* Debug */, 744 | 1802BB7D7D0B4B5FB90DBB94C25EE9BF /* Release */, 745 | ); 746 | defaultConfigurationIsVisible = 0; 747 | defaultConfigurationName = Release; 748 | }; 749 | 17354003706CADA2BC88186394F82C7B /* Build configuration list for PBXNativeTarget "Pods-AHDownloadButton_Tests" */ = { 750 | isa = XCConfigurationList; 751 | buildConfigurations = ( 752 | A6B6157A7C2B08D3A3986F3F5EAF5FFD /* Debug */, 753 | B7D486BEBF661A31DF9B834AA3B625C1 /* Release */, 754 | ); 755 | defaultConfigurationIsVisible = 0; 756 | defaultConfigurationName = Release; 757 | }; 758 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 759 | isa = XCConfigurationList; 760 | buildConfigurations = ( 761 | 5011B865762FC0C0A28ECEC4CB63DC68 /* Debug */, 762 | 827269710C98D60C14D46BC6AF9BF728 /* Release */, 763 | ); 764 | defaultConfigurationIsVisible = 0; 765 | defaultConfigurationName = Release; 766 | }; 767 | 802A19775C2F58BD7139B313E1603049 /* Build configuration list for PBXNativeTarget "Pods-AHDownloadButton_Example" */ = { 768 | isa = XCConfigurationList; 769 | buildConfigurations = ( 770 | 99C40C91D584530A758F189296374BA3 /* Debug */, 771 | 826BC7A2EB2126BC25A9C32FF4E3EDEB /* Release */, 772 | ); 773 | defaultConfigurationIsVisible = 0; 774 | defaultConfigurationName = Release; 775 | }; 776 | /* End XCConfigurationList section */ 777 | }; 778 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 779 | } 780 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/AHDownloadButton.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/AHDownloadButton-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AHDownloadButton : NSObject 3 | @end 4 | @implementation PodsDummy_AHDownloadButton 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/AHDownloadButton-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/AHDownloadButton-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double AHDownloadButtonVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AHDownloadButtonVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/AHDownloadButton.modulemap: -------------------------------------------------------------------------------- 1 | framework module AHDownloadButton { 2 | umbrella header "AHDownloadButton-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/AHDownloadButton.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "UIKit" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AHDownloadButton/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AHDownloadButton 5 | 6 | Copyright (c) 2018 hukicamer@gmail.com 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2018 hukicamer@gmail.com <hukicamer@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AHDownloadButton 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AHDownloadButton_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AHDownloadButton_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 71 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 85 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 86 | else 87 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | 136 | if [[ "$CONFIGURATION" == "Debug" ]]; then 137 | install_framework "${BUILT_PRODUCTS_DIR}/AHDownloadButton/AHDownloadButton.framework" 138 | fi 139 | if [[ "$CONFIGURATION" == "Release" ]]; then 140 | install_framework "${BUILT_PRODUCTS_DIR}/AHDownloadButton/AHDownloadButton.framework" 141 | fi 142 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 143 | wait 144 | fi 145 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AHDownloadButton_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AHDownloadButton_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton/AHDownloadButton.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AHDownloadButton" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AHDownloadButton_Example { 2 | umbrella header "Pods-AHDownloadButton_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton/AHDownloadButton.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "AHDownloadButton" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AHDownloadButton_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AHDownloadButton_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 71 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 85 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 86 | else 87 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 136 | wait 137 | fi 138 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AHDownloadButton_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AHDownloadButton_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton/AHDownloadButton.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AHDownloadButton_Tests { 2 | umbrella header "Pods-AHDownloadButton_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-AHDownloadButton_Tests/Pods-AHDownloadButton_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AHDownloadButton/AHDownloadButton.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Tests/AHDownloadButtonDelegateMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AHDownloadButtonDelegateMock.swift 3 | // AHDownloadButton_Example 4 | // 5 | // Created by Amer Hukic on 29/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import AHDownloadButton 11 | 12 | class AHDownloadButtonDelegateMock: AHDownloadButtonDelegate { 13 | 14 | var didCallStateChangeMethod = false 15 | var didCallTappedMethod = false 16 | 17 | func downloadButton(_ downloadButton: AHDownloadButton, stateChanged state: AHDownloadButton.State) { 18 | didCallStateChangeMethod = true 19 | } 20 | 21 | func downloadButton(_ downloadButton: AHDownloadButton, tappedWithState state: AHDownloadButton.State) { 22 | didCallTappedMethod = true 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Example/Tests/AHDownloadButtonTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AHDownloadButtonTests.swift 3 | // AHDownloadButton_Tests 4 | // 5 | // Created by Amer Hukic on 28/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AHDownloadButton 11 | 12 | class AHDownloadButtonTests: XCTestCase { 13 | 14 | var downloadButton: AHDownloadButton! 15 | 16 | override func setUp() { 17 | super.setUp() 18 | downloadButton = AHDownloadButton() 19 | } 20 | 21 | override func tearDown() { 22 | super.tearDown() 23 | downloadButton = nil 24 | } 25 | 26 | func testInitWithAlignmentShouldSetAlignment() { 27 | let button = AHDownloadButton(alignment: .center) 28 | XCTAssert(button.contentHorizontalAlignment == .center) 29 | } 30 | 31 | func testInitWithFrameShouldSetAlignmentCenter() { 32 | let button = AHDownloadButton(frame: .zero) 33 | XCTAssert(button.contentHorizontalAlignment == .center) 34 | } 35 | 36 | func testSettingStartDownloadCustomizationPropertiesShouldSetCorrectPropertiesInStartDownloadButton() { 37 | downloadButton.startDownloadButtonHighlightedBackgroundColor = .red 38 | XCTAssert(downloadButton.startDownloadButtonHighlightedBackgroundColor == downloadButton.startDownloadButton.highlightedBackgroundColor) 39 | 40 | downloadButton.startDownloadButtonNonhighlightedBackgroundColor = .red 41 | XCTAssert(downloadButton.startDownloadButtonNonhighlightedBackgroundColor == downloadButton.startDownloadButton.nonhighlightedBackgroundColor) 42 | 43 | downloadButton.startDownloadButtonHighlightedTitleColor = .red 44 | XCTAssert(downloadButton.startDownloadButtonHighlightedTitleColor == downloadButton.startDownloadButton.highlightedTitleColor) 45 | 46 | downloadButton.startDownloadButtonNonhighlightedTitleColor = .red 47 | XCTAssert(downloadButton.startDownloadButtonNonhighlightedTitleColor == downloadButton.startDownloadButton.nonhighlightedTitleColor) 48 | } 49 | 50 | func testSettingPendingCustomizationPropertiesShouldSetCorrectPropertiesInPendingView() { 51 | downloadButton.pendingCircleColor = .red 52 | XCTAssert(downloadButton.pendingCircleColor == downloadButton.pendingCircleView.circleColor) 53 | 54 | downloadButton.pendingCircleLineWidth = 3 55 | XCTAssert(downloadButton.pendingCircleLineWidth == downloadButton.pendingCircleView.lineWidth) 56 | } 57 | 58 | func testSettingDownloadingButtonCustomizationPropertiesShouldSetCorrectPropertiesInDownloadingButton() { 59 | downloadButton.downloadingButtonNonhighlightedTrackCircleColor = .red 60 | XCTAssert(downloadButton.downloadingButtonNonhighlightedTrackCircleColor == downloadButton.downloadingButton.nonhighlightedTrackCircleColor) 61 | 62 | downloadButton.downloadingButtonHighlightedTrackCircleColor = .red 63 | XCTAssert(downloadButton.downloadingButtonHighlightedTrackCircleColor == downloadButton.downloadingButton.highlightedTrackCircleColor) 64 | 65 | downloadButton.downloadingButtonNonhighlightedProgressCircleColor = .red 66 | XCTAssert(downloadButton.downloadingButtonNonhighlightedProgressCircleColor == downloadButton.downloadingButton.nonhighlightedProgressCircleColor) 67 | 68 | downloadButton.downloadingButtonHighlightedProgressCircleColor = .red 69 | XCTAssert(downloadButton.downloadingButtonHighlightedProgressCircleColor == downloadButton.downloadingButton.highlightedProgressCircleColor) 70 | 71 | downloadButton.downloadingButtonNonhighlightedStopViewColor = .red 72 | XCTAssert(downloadButton.downloadingButtonNonhighlightedStopViewColor == downloadButton.downloadingButton.nonhighlightedStopViewColor) 73 | 74 | downloadButton.downloadingButtonHighlightedStopViewColor = .red 75 | XCTAssert(downloadButton.downloadingButtonHighlightedStopViewColor == downloadButton.downloadingButton.highlightedStopViewColor) 76 | 77 | downloadButton.downloadingButtonCircleLineWidth = 4 78 | XCTAssert(downloadButton.downloadingButtonCircleLineWidth == downloadButton.downloadingButton.circleViewLineWidth) 79 | } 80 | 81 | func testSettingDownloadedButtonCustomizationPropertiesShouldSetCorrectPropertiesInDownloadedButton() { 82 | downloadButton.downloadedButtonHighlightedBackgroundColor = .red 83 | XCTAssert(downloadButton.downloadedButtonHighlightedBackgroundColor == downloadButton.downloadedButton.highlightedBackgroundColor) 84 | 85 | downloadButton.downloadedButtonNonhighlightedBackgroundColor = .red 86 | XCTAssert(downloadButton.downloadedButtonNonhighlightedBackgroundColor == downloadButton.downloadedButton.nonhighlightedBackgroundColor) 87 | 88 | downloadButton.downloadedButtonHighlightedTitleColor = .red 89 | XCTAssert(downloadButton.downloadedButtonHighlightedTitleColor == downloadButton.downloadedButton.highlightedTitleColor) 90 | 91 | downloadButton.downloadedButtonNonhighlightedTitleColor = .red 92 | XCTAssert(downloadButton.downloadedButtonNonhighlightedTitleColor == downloadButton.downloadedButton.nonhighlightedTitleColor) 93 | } 94 | 95 | func testSettingStateShouldNotifyDelegate() { 96 | let delegate = AHDownloadButtonDelegateMock() 97 | downloadButton.delegate = delegate 98 | 99 | downloadButton.state = .startDownload 100 | 101 | XCTAssertTrue(delegate.didCallStateChangeMethod) 102 | } 103 | 104 | func testSettingStateShouldExecuteCallbackClosure() { 105 | var didCall = false 106 | downloadButton.downloadButtonStateChangedAction = { _, _ in 107 | didCall = true 108 | } 109 | 110 | downloadButton.state = .startDownload 111 | 112 | XCTAssertTrue(didCall) 113 | } 114 | 115 | func testTappingButtonShouldNotifyDelegate() { 116 | let delegate = AHDownloadButtonDelegateMock() 117 | downloadButton.delegate = delegate 118 | 119 | downloadButton.startDownloadButton.sendActions(for: .touchUpInside) 120 | XCTAssertTrue(delegate.didCallTappedMethod) 121 | 122 | delegate.didCallTappedMethod = false 123 | downloadButton.downloadingButton.sendActions(for: .touchUpInside) 124 | XCTAssertTrue(delegate.didCallTappedMethod) 125 | 126 | delegate.didCallTappedMethod = false 127 | downloadButton.downloadedButton.sendActions(for: .touchUpInside) 128 | XCTAssertTrue(delegate.didCallTappedMethod) 129 | } 130 | 131 | func testTappingButtonShouldExecuteCallbackClosure() { 132 | var didCall = false 133 | downloadButton.didTapDownloadButtonAction = { _, _ in 134 | didCall = true 135 | } 136 | 137 | downloadButton.startDownloadButton.sendActions(for: .touchUpInside) 138 | XCTAssertTrue(didCall) 139 | 140 | didCall = false 141 | downloadButton.downloadingButton.sendActions(for: .touchUpInside) 142 | XCTAssertTrue(didCall) 143 | 144 | didCall = false 145 | downloadButton.downloadedButton.sendActions(for: .touchUpInside) 146 | XCTAssertTrue(didCall) 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Example/Tests/CircleViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircleViewTests.swift 3 | // AHDownloadButton_Tests 4 | // 5 | // Created by Amer Hukic on 28/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AHDownloadButton 11 | 12 | class CircleViewTests: XCTestCase { 13 | 14 | var circleView: CircleView! 15 | 16 | override func setUp() { 17 | super.setUp() 18 | circleView = CircleView() 19 | } 20 | 21 | override func tearDown() { 22 | super.tearDown() 23 | circleView = nil 24 | } 25 | 26 | func testSettingLineWidthShouldSetLayerLineWidth() { 27 | circleView.lineWidth = 2 28 | XCTAssert(circleView.circleLayer.lineWidth == 2) 29 | } 30 | 31 | func testSettingCircleColorShouldSetLayerStrokeColor() { 32 | circleView.circleColor = .white 33 | XCTAssert(circleView.circleLayer.strokeColor == UIColor.white.cgColor) 34 | } 35 | 36 | func testLayoutSubviewsShouldCreateCircleLayerPath() { 37 | circleView.layoutSubviews() 38 | XCTAssertNotNil(circleView.circleLayer.path) 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Example/Tests/HighlightableRoundedButtonTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HighlightableRoundedButtonTests.swift 3 | // AHDownloadButton_Tests 4 | // 5 | // Created by Amer Hukic on 28/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AHDownloadButton 11 | 12 | class HighlightableRoundedButtonTests: XCTestCase { 13 | 14 | var highlightableRoundedButton: HighlightableRoundedButton! 15 | 16 | override func setUp() { 17 | highlightableRoundedButton = HighlightableRoundedButton() 18 | } 19 | 20 | override func tearDown() { 21 | highlightableRoundedButton = nil 22 | } 23 | 24 | func testSettingIsHighlightedShouldUpdateButtonColors() { 25 | highlightableRoundedButton.isHighlighted = true 26 | XCTAssertTrue(highlightableRoundedButton.backgroundColor == highlightableRoundedButton.highlightedBackgroundColor) 27 | XCTAssertTrue(highlightableRoundedButton.titleColor(for: .normal) == highlightableRoundedButton.highlightedTitleColor) 28 | 29 | highlightableRoundedButton.isHighlighted = false 30 | XCTAssertTrue(highlightableRoundedButton.backgroundColor == highlightableRoundedButton.nonhighlightedBackgroundColor) 31 | XCTAssertTrue(highlightableRoundedButton.titleColor(for: .normal) == highlightableRoundedButton.nonhighlightedTitleColor) 32 | } 33 | 34 | func testLayoutSubviewsShouldUpdateCornerRadius() { 35 | highlightableRoundedButton.layoutSubviews() 36 | XCTAssertTrue(highlightableRoundedButton.layer.cornerRadius == highlightableRoundedButton.frame.height / 2) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Example/Tests/HorizontalAlignmentTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HorizontalAlignmentTests.swift 3 | // AHDownloadButton_Tests 4 | // 5 | // Created by Amer Hukic on 30/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AHDownloadButton 11 | 12 | class HorizontalAlignmentTests: XCTestCase { 13 | 14 | var horizontalAlignment: AHDownloadButton.HorizontalAlignment! 15 | 16 | override func setUp() { 17 | horizontalAlignment = .left 18 | } 19 | 20 | override func tearDown() { 21 | horizontalAlignment = nil 22 | } 23 | 24 | func testHorizontalAlignmentLeftShouldReturnLeftLayoutAttribute() { 25 | horizontalAlignment = .left 26 | XCTAssert(horizontalAlignment.relativeLayoutAttribute == .left) 27 | } 28 | 29 | func testHorizontalAlignmentCenterShouldReturnCenterXLayoutAttribute() { 30 | horizontalAlignment = .center 31 | XCTAssert(horizontalAlignment.relativeLayoutAttribute == .centerX) 32 | } 33 | 34 | func testHorizontalAlignmentRightShouldReturnRightLayoutAttribute() { 35 | horizontalAlignment = .right 36 | XCTAssert(horizontalAlignment.relativeLayoutAttribute == .right) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/ProgressButtonTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressButtonTests.swift 3 | // AHDownloadButton_Tests 4 | // 5 | // Created by Amer Hukic on 28/01/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AHDownloadButton 11 | 12 | class ProgressButtonTests: XCTestCase { 13 | 14 | var progressButton: ProgressButton! 15 | 16 | override func setUp() { 17 | progressButton = ProgressButton() 18 | } 19 | 20 | override func tearDown() { 21 | progressButton = nil 22 | } 23 | 24 | func testSettingCircleLineWidthShouldSetTrackAndProgressCircleLineWidth() { 25 | progressButton.circleViewLineWidth = 20 26 | 27 | let expression = progressButton.circleViewLineWidth == progressButton.trackCircleView.lineWidth && progressButton.circleViewLineWidth == progressButton.progressCircleView.lineWidth 28 | XCTAssertTrue(expression) 29 | } 30 | 31 | func testSettingProgressLessThanZeroShouldSetProgressToZero() { 32 | progressButton.progress = -2 33 | XCTAssertTrue(progressButton.progress == 0) 34 | } 35 | 36 | func testSettingProgressGreaterThanOneShouldSetProgressToOne() { 37 | progressButton.progress = 2 38 | XCTAssertTrue(progressButton.progress == 1) 39 | } 40 | 41 | func testSettingProgressShouldSetProgressCircleViewProgress() { 42 | progressButton.progress = 0.5 43 | XCTAssertTrue(progressButton.progress == progressButton.progressCircleView.progress) 44 | } 45 | 46 | func testSettingStopButtonCornerRadiusShouldSetStopViewCornerRadius() { 47 | progressButton.stopButtonCornerRadius = 3 48 | XCTAssertTrue(progressButton.stopButtonCornerRadius == progressButton.stopView.layer.cornerRadius) 49 | } 50 | 51 | func testSettingIsHighlightedShouldUpdateProgressButtonColors() { 52 | progressButton.isHighlighted = true 53 | XCTAssertTrue(progressButton.trackCircleView.circleColor == progressButton.highlightedTrackCircleColor) 54 | XCTAssertTrue(progressButton.progressCircleView.circleColor == progressButton.highlightedProgressCircleColor) 55 | XCTAssertTrue(progressButton.stopView.backgroundColor == progressButton.highlightedStopViewColor) 56 | 57 | progressButton.isHighlighted = false 58 | XCTAssertTrue(progressButton.trackCircleView.circleColor == progressButton.nonhighlightedTrackCircleColor) 59 | XCTAssertTrue(progressButton.progressCircleView.circleColor == progressButton.nonhighlightedProgressCircleColor) 60 | XCTAssertTrue(progressButton.stopView.backgroundColor == progressButton.nonhighlightedStopViewColor) 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 hukicamer@gmail.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/AHDownloadButton/5ea4c1d39d7931201dac0b08eaadb1a5904e27be/Logo.png -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "AHDownloadButton", 7 | platforms: [ 8 | .iOS(.v8) 9 | ], 10 | products: [ 11 | .library( 12 | name: "AHDownloadButton", 13 | targets: ["AHDownloadButton"]), 14 | ], 15 | targets: [ 16 | .target( 17 | name: "AHDownloadButton", 18 | dependencies: []) 19 | ], 20 | swiftLanguageVersions: [ 21 | .v5 22 | ] 23 | ) 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Logo 3 |

4 | 5 |

6 | 7 | 8 | Pod Version 9 | 10 | 11 | SPM compatible 12 | 13 | 14 | Carthage compatible 15 | 16 | 17 | License 18 | 19 | 20 | Twitter: @hukicamer 21 | 22 |

23 | 24 | **AHDownloadButton** is a customizable download button similar to the download button in the latest version of Apple's App Store app (since iOS 11). 25 | It features download progress animation as well as animated transitions between download states: start download, pending, downloading and downloaded. [You can find more details about the implementation on my blog](https://amerhukic.com/replicating-app-store-download-button). 26 | 27 |

28 |

29 | 30 | ## Requirements 31 | 32 | - iOS 8.0+ 33 | - Xcode 10.2+ 34 | - Swift 5.0+ 35 | 36 | ## Usage 37 | 38 | ### Code 39 | To use `AHDownloadButton` in code, you simply create a new instance and add it as a subview to your desired view: 40 | ```swift 41 | let downloadButton = AHDownloadButton() 42 | downloadButton.frame = CGRect(origin: origin, size: size) 43 | view.addSubview(downloadButton) 44 | ``` 45 | The button can have 4 different states: 46 | - `startDownload` - initial state before downloading 47 | - `pending` - state for preparing for download 48 | - `downloading` - state when the user is downloading 49 | - `downloaded` - state when the user finished downloading 50 | 51 | The state of the button can be changed through its `state` property. 52 | 53 | ### Delegate 54 | You can use the `AHDownloadButtonDelegate` to monitor taps on the button and update button's state if needed. To update the current download progress, use the `progress` property. Here is an example how it could be implemented: 55 | 56 | ```swift 57 | extension DownloadViewController: AHDownloadButtonDelegate { 58 | 59 | func downloadButton(_ downloadButton: AHDownloadButton, tappedWithState state: AHDownloadButton.State) 60 | switch state { 61 | case .startDownload: 62 | 63 | // set the download progress to 0 64 | downloadButton.progress = 0 65 | 66 | // change state to pending and wait for download to start 67 | downloadButton.state = .pending 68 | 69 | // initiate download and update state to .downloading 70 | startDownloadingFile() 71 | 72 | case .pending: 73 | 74 | // button tapped while in pending state 75 | break 76 | 77 | case .downloading: 78 | 79 | // button tapped while in downloading state - stop downloading 80 | downloadButton.progress = 0 81 | downloadButton.state = .startDownload 82 | 83 | case .downloaded: 84 | 85 | // file is downloaded and can be opened 86 | openDownloadedFile() 87 | 88 | } 89 | } 90 | } 91 | ``` 92 | 93 | You can also use closures instead of the `AHDownloadButtonDelegate` by setting the `didTapDownloadButtonAction` and `downloadButtonStateChangedAction` properties. 94 | 95 | ### Customisation 96 | 97 | `AHDownloadButton` can be customized. These are the properties that can be used for customizing the button: 98 | 99 | 1. Use the custom initializer `init(alignment: HorizontalAlignment)` to set the horizontal alignment property. `HorizontalAlignment` determines the position of the pending and downloading circles. The position can either be `center` , `left` or `right`. The default value is `center`. 100 | 101 | 102 | 2. Customization properties when button is in `startDownload` state: 103 | 104 | - `startDownloadButtonTitle` - button's title 105 | - `startDownloadButtonTitleFont` - button's title font 106 | - `startDownloadButtonTitleSidePadding` - padding for left and right side of button's title 107 | - `startDownloadButtonHighlightedBackgroundColor` - background color for the button when it's in highlighted state (when the user presses the button) 108 | - `startDownloadButtonNonhighlightedBackgroundColor` - background color for the button when it's in nonhighlighted state (when the button is not pressed) 109 | - `startDownloadButtonHighlightedTitleColor` - title color for the button when it's in highlighted state (when the user presses the button) 110 | - `startDownloadButtonNonhighlightedTitleColor` - title color for the button when it's in nonhighlighted state (when the button is not pressed) 111 | 112 | 113 | 3. Customization properties when button is in `pending` state: 114 | 115 | - `pendingCircleColor` - color of the pending circle 116 | - `pendingCircleLineWidth` - width of the pending circle 117 | 118 | 119 | 4. Customization properties when button is in `downloading` state: 120 | 121 | - `downloadingButtonHighlightedTrackCircleColor` - color for the track circle when it's in highlighted state (when the user presses the button) 122 | - `downloadingButtonNonhighlightedTrackCircleColor` - color for the track circle when it's in nonhighlighted state (when the button is not pressed) 123 | - `downloadingButtonHighlightedProgressCircleColor` - color for the progress circle when it's in highlighted state (when the user presses the button) 124 | - `downloadingButtonNonhighlightedProgressCircleColor` - color for the progress circle when it's in nonhighlighted state (when the button is not pressed) 125 | - `downloadingButtonHighlightedStopViewColor` - color for the stop view in the middle of the progress circle when it's in highlighted state (when the user presses the button) 126 | - `downloadingButtonNonhighlightedStopViewColor` - color for the stop view in the middle of the progress circle when it's in nonhighlighted state (when the button is not pressed) 127 | - `downloadingButtonCircleLineWidth` - width of the downloading circle 128 | 129 | 130 | 5. Customization properties when button is in `downloaded` state: 131 | 132 | - `downloadedButtonTitle` - button's title 133 | - `downloadedButtonTitleFont` - button's title font 134 | - `downloadedButtonTitleSidePadding` - padding for left and right side of button's title 135 | - `downloadedButtonHighlightedBackgroundColor` - background color for the button when it's in highlighted state (when the user presses the button) 136 | - `downloadedButtonNonhighlightedBackgroundColor` - background color for the button when it's in nonhighlighted state (when the button is not pressed) 137 | - `downloadedButtonHighlightedTitleColor` - title color for the button when it's in highlighted state (when the user presses the button) 138 | - `downloadedButtonNonhighlightedTitleColor` - title color for the button when it's in nonhighlighted state (when the button is not pressed) 139 | 140 | 6. `transitionAnimationDuration` - animation duration between the different states of the button 141 | 142 | ### Special note 143 | 144 | `AHDownloadButton` in `startDownload` and `downloaded` states calculates its width based on **button title**. Use the `startDownloadButtonTitleSidePadding` and `downloadedButtonTitleSidePadding` properties to customise the width when the button is in the aforementioned states. 145 | 146 | ## Example 147 | 148 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 149 | 150 | ## Installation 151 | 152 | ### CocoaPods 153 | 154 | [CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: 155 | 156 | ```bash 157 | $ gem install cocoapods 158 | ``` 159 | 160 | To integrate AHDownloadButton into your Xcode project using CocoaPods, specify it in your `Podfile`: 161 | 162 | ```ruby 163 | source 'https://github.com/CocoaPods/Specs.git' 164 | platform :ios, '8.0' 165 | use_frameworks! 166 | 167 | target '' do 168 | pod 'AHDownloadButton' 169 | end 170 | ``` 171 | 172 | Then, run the following command: 173 | 174 | ```bash 175 | $ pod install 176 | ``` 177 | 178 | ### Carthage 179 | 180 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate AHDownloadButton into your Xcode project using Carthage, specify it in your `Cartfile`: 181 | 182 | ```ogdl 183 | github "amerhukic/AHDownloadButton" ~> 1.3.0 184 | ``` 185 | 186 | ### Swift Package Manager 187 | 188 | The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. 189 | 190 | Once you have your Swift package set up, adding AHDownloadButton as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. 191 | 192 | ```swift 193 | dependencies: [ 194 | .package(url: "https://github.com/amerhukic/AHDownloadButton", .upToNextMajor(from: "1.3.0")) 195 | ] 196 | ``` 197 | 198 | ## Author 199 | 200 | [Amer Hukić](https://amerhukic.com) 201 | 202 | ## License 203 | 204 | AHDownloadButton is licensed under the MIT license. Check the [LICENSE](LICENSE) file for details. 205 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/AHDownloadButton/5ea4c1d39d7931201dac0b08eaadb1a5904e27be/Sources/AHDownloadButton/Assets/.gitkeep -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amerhukic/AHDownloadButton/5ea4c1d39d7931201dac0b08eaadb1a5904e27be/Sources/AHDownloadButton/Classes/.gitkeep -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/AHDownloadButton+StateTransitionAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AHDownloadButton+StateTransitionAnimation.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 04/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension AHDownloadButton { 12 | 13 | func animateTransition(from oldState: State, to newState: State) { 14 | 15 | let completion: (Bool) -> Void = { _ in 16 | self.animationDispatchGroup.leave() 17 | self.resetStateViews(except: newState) 18 | } 19 | 20 | switch (oldState, newState) { 21 | case (.startDownload, .pending): 22 | animateTransitionFromStartDownloadToPending(completion: completion) 23 | 24 | case (.startDownload, .downloading): 25 | animateTransitionFromStartDownloadToDownloading(completion: completion) 26 | 27 | case (.pending, .startDownload): 28 | animateTransitionFromPendingToStartDownload(completion: completion) 29 | 30 | case (.pending, .downloading): 31 | animateTransitionFromPendingToDownloading(completion: completion) 32 | 33 | case (.downloading, .downloaded): 34 | animateTransitionFromDownloadingToDownloaded(completion: completion) 35 | 36 | case (.downloading, .startDownload): 37 | animateTransitionFromDownloadingToStartDownload(completion: completion) 38 | 39 | default: 40 | handleUnsupportedTransitionAnimation(toState: newState) 41 | } 42 | } 43 | 44 | private func animateTransitionFromStartDownloadToPending(completion: @escaping (Bool) -> Void) { 45 | startDownloadButton.titleLabel?.alpha = 0 46 | startDownloadButtonWidthConstraint.constant = pendingViewWidthConstraint.constant 47 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 48 | self.layoutIfNeeded() 49 | }, completion: { completed in 50 | completion(completed) 51 | self.pendingCircleView.alpha = 1 52 | self.pendingCircleView.startSpinning() 53 | }) 54 | } 55 | 56 | private func animateTransitionFromStartDownloadToDownloading(completion: @escaping (Bool) -> Void) { 57 | startDownloadButton.titleLabel?.alpha = 0 58 | startDownloadButtonWidthConstraint.constant = downloadingButtonWidthConstraint.constant 59 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 60 | self.layoutIfNeeded() 61 | }, completion: { completed in 62 | completion(completed) 63 | self.downloadingButton.alpha = 1 64 | }) 65 | } 66 | 67 | private func animateTransitionFromPendingToStartDownload(completion: @escaping (Bool) -> Void) { 68 | startDownloadButtonWidthConstraint.constant = pendingViewWidthConstraint.constant 69 | layoutIfNeeded() 70 | 71 | startDownloadButton.alpha = 1 72 | startDownloadButtonWidthConstraint.constant = startDownloadButtonFullWidth 73 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 74 | self.pendingCircleView.alpha = 0 75 | self.startDownloadButton.titleLabel?.alpha = 1 76 | self.layoutIfNeeded() 77 | }, completion: completion) 78 | } 79 | 80 | private func animateTransitionFromPendingToDownloading(completion: @escaping (Bool) -> Void) { 81 | pendingCircleView.alpha = 1 82 | downloadingButton.alpha = 0 83 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 84 | self.pendingCircleView.alpha = 0 85 | self.downloadingButton.alpha = 1 86 | }, completion: completion) 87 | } 88 | 89 | private func animateTransitionFromDownloadingToDownloaded(completion: @escaping (Bool) -> Void) { 90 | downloadedButton.alpha = 1 91 | downloadedButtonWidthConstraint.constant = downloadingButtonWidthConstraint.constant 92 | layoutIfNeeded() 93 | 94 | downloadedButton.titleLabel?.alpha = 0 95 | downloadedButtonWidthConstraint.constant = downloadedButtonFullWidth 96 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 97 | self.downloadingButton.alpha = 0 98 | self.downloadedButton.titleLabel?.alpha = 1 99 | self.layoutIfNeeded() 100 | }, completion: completion) 101 | } 102 | 103 | private func animateTransitionFromDownloadingToStartDownload(completion: @escaping (Bool) -> Void) { 104 | startDownloadButtonWidthConstraint.constant = downloadingButtonWidthConstraint.constant 105 | layoutIfNeeded() 106 | 107 | downloadingButton.alpha = 0 108 | startDownloadButton.alpha = 1 109 | startDownloadButtonWidthConstraint.constant = startDownloadButtonFullWidth 110 | UIView.animate(withDuration: transitionAnimationDuration, animations: { 111 | self.startDownloadButton.titleLabel?.alpha = 1 112 | self.layoutIfNeeded() 113 | }, completion: completion) 114 | } 115 | 116 | private func handleUnsupportedTransitionAnimation(toState newState: State) { 117 | switch newState { 118 | case .startDownload: 119 | startDownloadButton.alpha = 1 120 | case .pending: 121 | pendingCircleView.alpha = 1 122 | case .downloading: 123 | downloadingButton.alpha = 1 124 | case .downloaded: 125 | downloadedButton.alpha = 1 126 | } 127 | resetStateViews(except: newState) 128 | animationDispatchGroup.leave() 129 | } 130 | 131 | private func resetStateViews(except state: State) { 132 | 133 | if state != .startDownload { 134 | startDownloadButton.alpha = 0 135 | startDownloadButton.titleLabel?.alpha = 1 136 | startDownloadButtonWidthConstraint.constant = startDownloadButtonFullWidth 137 | } 138 | 139 | if state != .pending { 140 | pendingCircleView.alpha = 0 141 | } 142 | 143 | if state != .downloading { 144 | downloadingButton.alpha = 0 145 | progress = 0 146 | } 147 | 148 | if state != .downloaded { 149 | downloadedButton.alpha = 0 150 | downloadedButton.titleLabel?.alpha = 1 151 | downloadedButtonWidthConstraint.constant = downloadedButtonFullWidth 152 | } 153 | 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/AHDownloadButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AHDownloadButton.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol AHDownloadButtonDelegate: AnyObject { 12 | @available(*, deprecated, message: "Use downloadButton(_:, tappedWithState:) method") 13 | func didTapDownloadButton(_ downloadButton: AHDownloadButton, withState state: AHDownloadButton.State) 14 | func downloadButton(_ downloadButton: AHDownloadButton, stateChanged state: AHDownloadButton.State) 15 | func downloadButton(_ downloadButton: AHDownloadButton, tappedWithState state: AHDownloadButton.State) 16 | } 17 | 18 | public extension AHDownloadButtonDelegate { 19 | func didTapDownloadButton(_ downloadButton: AHDownloadButton, withState state: AHDownloadButton.State) { } 20 | func downloadButton(_ downloadButton: AHDownloadButton, stateChanged state: AHDownloadButton.State) { } 21 | func downloadButton(_ downloadButton: AHDownloadButton, tappedWithState state: AHDownloadButton.State) { } 22 | } 23 | 24 | public final class AHDownloadButton: UIView { 25 | 26 | public enum State { 27 | case startDownload 28 | case pending 29 | case downloading 30 | case downloaded 31 | } 32 | 33 | public enum HorizontalAlignment: Int { 34 | case center, left, right 35 | 36 | var relativeLayoutAttribute: NSLayoutConstraint.Attribute { 37 | switch self { 38 | case .center: return .centerX 39 | case .right: return .right 40 | case .left: return .left 41 | } 42 | } 43 | } 44 | 45 | // MARK: Public properties 46 | 47 | /// Start download button customisation properties 48 | 49 | public var startDownloadButtonTitle: String = "GET" { 50 | didSet { 51 | startDownloadButton.setTitle(startDownloadButtonTitle, for: .normal) 52 | startDownloadButtonTitleWidth = 0 53 | } 54 | } 55 | 56 | public var startDownloadButtonTitleFont: UIFont = .boldSystemFont(ofSize: 15) { 57 | didSet { 58 | startDownloadButton.titleLabel?.font = startDownloadButtonTitleFont 59 | } 60 | } 61 | 62 | public var startDownloadButtonTitleSidePadding: CGFloat = 12 63 | 64 | public var startDownloadButtonHighlightedBackgroundColor: UIColor = Color.Gray.light { 65 | didSet { 66 | startDownloadButton.highlightedBackgroundColor = startDownloadButtonHighlightedBackgroundColor 67 | } 68 | } 69 | 70 | public var startDownloadButtonNonhighlightedBackgroundColor: UIColor = Color.Gray.medium { 71 | didSet { 72 | startDownloadButton.nonhighlightedBackgroundColor = startDownloadButtonNonhighlightedBackgroundColor 73 | } 74 | } 75 | 76 | public var startDownloadButtonHighlightedTitleColor: UIColor = Color.Blue.light { 77 | didSet { 78 | startDownloadButton.highlightedTitleColor = startDownloadButtonHighlightedTitleColor 79 | } 80 | } 81 | 82 | public var startDownloadButtonNonhighlightedTitleColor: UIColor = Color.Blue.medium { 83 | didSet { 84 | startDownloadButton.nonhighlightedTitleColor = startDownloadButtonNonhighlightedTitleColor 85 | } 86 | } 87 | 88 | /// Pending view customisation properties 89 | 90 | public var pendingCircleColor: UIColor = Color.Gray.dark { 91 | didSet { 92 | pendingCircleView.circleColor = pendingCircleColor 93 | } 94 | } 95 | 96 | public var pendingCircleLineWidth: CGFloat = 2 { 97 | didSet { 98 | pendingCircleView.lineWidth = pendingCircleLineWidth 99 | } 100 | } 101 | 102 | /// Downloading button customisation properties 103 | 104 | public var downloadingButtonNonhighlightedTrackCircleColor: UIColor = Color.Gray.medium { 105 | didSet { 106 | downloadingButton.nonhighlightedTrackCircleColor = downloadingButtonNonhighlightedTrackCircleColor 107 | } 108 | } 109 | 110 | public var downloadingButtonHighlightedTrackCircleColor: UIColor = Color.Gray.light { 111 | didSet { 112 | downloadingButton.highlightedTrackCircleColor = downloadingButtonHighlightedTrackCircleColor 113 | } 114 | } 115 | 116 | public var downloadingButtonNonhighlightedProgressCircleColor: UIColor = Color.Blue.medium { 117 | didSet { 118 | downloadingButton.nonhighlightedProgressCircleColor = downloadingButtonNonhighlightedProgressCircleColor 119 | } 120 | } 121 | 122 | public var downloadingButtonHighlightedProgressCircleColor: UIColor = Color.Blue.light { 123 | didSet { 124 | downloadingButton.highlightedProgressCircleColor = downloadingButtonHighlightedProgressCircleColor 125 | } 126 | } 127 | 128 | public var downloadingButtonNonhighlightedStopViewColor: UIColor = Color.Blue.medium { 129 | didSet { 130 | downloadingButton.nonhighlightedStopViewColor = downloadingButtonNonhighlightedStopViewColor 131 | } 132 | } 133 | 134 | public var downloadingButtonHighlightedStopViewColor: UIColor = Color.Blue.light { 135 | didSet { 136 | downloadingButton.highlightedStopViewColor = downloadingButtonHighlightedStopViewColor 137 | } 138 | } 139 | 140 | public var downloadingButtonCircleLineWidth: CGFloat = 6 { 141 | didSet { 142 | downloadingButton.circleViewLineWidth = downloadingButtonCircleLineWidth 143 | } 144 | } 145 | 146 | public var progress: CGFloat = 0 { 147 | didSet { 148 | downloadingButton.progress = progress 149 | } 150 | } 151 | 152 | /// Downloaded button customisation properties 153 | 154 | public var downloadedButtonTitle: String = "OPEN" { 155 | didSet { 156 | downloadedButton.setTitle(downloadedButtonTitle, for: .normal) 157 | downloadedButtonTitleWidth = 0 158 | } 159 | } 160 | 161 | public var downloadedButtonTitleFont: UIFont = .boldSystemFont(ofSize: 15) { 162 | didSet { 163 | downloadedButton.titleLabel?.font = downloadedButtonTitleFont 164 | } 165 | } 166 | 167 | public var downloadedButtonTitleSidePadding: CGFloat = 12 168 | 169 | public var downloadedButtonHighlightedBackgroundColor: UIColor = Color.Gray.light { 170 | didSet { 171 | downloadedButton.highlightedBackgroundColor = downloadedButtonHighlightedBackgroundColor 172 | } 173 | } 174 | 175 | public var downloadedButtonNonhighlightedBackgroundColor: UIColor = Color.Gray.medium { 176 | didSet { 177 | downloadedButton.nonhighlightedBackgroundColor = downloadedButtonNonhighlightedBackgroundColor 178 | } 179 | } 180 | 181 | public var downloadedButtonHighlightedTitleColor: UIColor = Color.Blue.light { 182 | didSet { 183 | downloadedButton.highlightedTitleColor = downloadedButtonHighlightedTitleColor 184 | } 185 | } 186 | 187 | public var downloadedButtonNonhighlightedTitleColor: UIColor = Color.Blue.medium { 188 | didSet { 189 | downloadedButton.nonhighlightedTitleColor = downloadedButtonNonhighlightedTitleColor 190 | } 191 | } 192 | 193 | /// State transformation 194 | 195 | public var state: State = .startDownload { 196 | didSet { 197 | delegate?.downloadButton(self, stateChanged: state) 198 | downloadButtonStateChangedAction?(self, state) 199 | animationQueue.async { [currentState = state] in 200 | self.animationDispatchGroup.enter() 201 | 202 | var delay: TimeInterval = 0 203 | if oldValue == .downloading && currentState == .downloaded && self.downloadingButton.progress == 1 { 204 | delay = self.downloadingButton.progressCircleView.progressAnimationDuration 205 | } 206 | 207 | DispatchQueue.main.asyncAfter(deadline: .now() + delay) { 208 | self.animateTransition(from: oldValue, to: currentState) 209 | } 210 | self.animationDispatchGroup.wait() 211 | } 212 | } 213 | } 214 | 215 | public var transitionAnimationDuration: TimeInterval = 0.1 216 | 217 | /// Callbacks 218 | 219 | public weak var delegate: AHDownloadButtonDelegate? 220 | 221 | public var didTapDownloadButtonAction: ((AHDownloadButton, State) -> Void)? 222 | 223 | public var downloadButtonStateChangedAction: ((AHDownloadButton, State) -> Void)? 224 | 225 | // MARK: Private properties 226 | 227 | let startDownloadButton: HighlightableRoundedButton = { 228 | let button = HighlightableRoundedButton() 229 | button.addTarget(self, action: #selector(currentButtonTapped), for: .touchUpInside) 230 | return button 231 | }() 232 | 233 | let pendingCircleView: CircleView = { 234 | let view = CircleView() 235 | view.endAngleRadians = view.startAngleRadians + 12 * .pi / 7 236 | return view 237 | }() 238 | 239 | let downloadingButton: ProgressButton = { 240 | let button = ProgressButton() 241 | button.addTarget(self, action: #selector(currentButtonTapped), for: .touchUpInside) 242 | return button 243 | }() 244 | 245 | let downloadedButton: HighlightableRoundedButton = { 246 | let button = HighlightableRoundedButton() 247 | button.addTarget(self, action: #selector(currentButtonTapped), for: .touchUpInside) 248 | return button 249 | }() 250 | 251 | let contentHorizontalAlignment: HorizontalAlignment 252 | 253 | // MARK: Animation 254 | 255 | let animationDispatchGroup = DispatchGroup() 256 | let animationQueue = DispatchQueue(label: "com.amerhukic.animation") 257 | 258 | // MARK: Constraints 259 | 260 | var startDownloadButtonWidthConstraint: NSLayoutConstraint! 261 | var pendingViewWidthConstraint: NSLayoutConstraint! 262 | var downloadingButtonWidthConstraint: NSLayoutConstraint! 263 | var downloadedButtonWidthConstraint: NSLayoutConstraint! 264 | var horizontalAlignmentAttribute: NSLayoutConstraint.Attribute { 265 | return contentHorizontalAlignment.relativeLayoutAttribute 266 | } 267 | 268 | var startDownloadButtonTitleWidth: CGFloat = 0 { 269 | didSet { 270 | startDownloadButtonWidthConstraint.constant = startDownloadButtonFullWidth 271 | } 272 | } 273 | 274 | var downloadedButtonTitleWidth: CGFloat = 0 { 275 | didSet { 276 | downloadedButtonWidthConstraint.constant = downloadedButtonFullWidth 277 | } 278 | } 279 | 280 | var startDownloadButtonFullWidth: CGFloat { 281 | return startDownloadButtonTitleWidth + 2 * startDownloadButtonTitleSidePadding 282 | } 283 | 284 | var downloadedButtonFullWidth: CGFloat { 285 | return downloadedButtonTitleWidth + 2 * downloadedButtonTitleSidePadding 286 | } 287 | 288 | // MARK: Initializers 289 | 290 | public init(alignment: HorizontalAlignment) { 291 | contentHorizontalAlignment = alignment 292 | super.init(frame: .zero) 293 | commonInit() 294 | } 295 | 296 | public override init(frame: CGRect) { 297 | contentHorizontalAlignment = .center 298 | super.init(frame: frame) 299 | commonInit() 300 | } 301 | 302 | public required init?(coder aDecoder: NSCoder) { 303 | contentHorizontalAlignment = .center 304 | super.init(coder: aDecoder) 305 | commonInit() 306 | } 307 | 308 | private func commonInit() { 309 | addSubview(startDownloadButton) 310 | setUpStartDownloadButtonProperties() 311 | setUpStartDownloadButtonConstraints() 312 | 313 | addSubview(pendingCircleView) 314 | setUpPendingCircleViewProperties() 315 | setUpPendingButtonConstraints() 316 | 317 | addSubview(downloadingButton) 318 | setUpDownloadingButtonProperties() 319 | setUpDownloadingButtonConstraints() 320 | 321 | addSubview(downloadedButton) 322 | setUpDownloadedButtonProperties() 323 | setUpDownloadedButtonConstraints() 324 | } 325 | 326 | // MARK: Style customisation 327 | 328 | private func setUpStartDownloadButtonProperties() { 329 | startDownloadButton.setTitle(startDownloadButtonTitle, for: .normal) 330 | startDownloadButton.titleLabel?.font = startDownloadButtonTitleFont 331 | startDownloadButton.highlightedBackgroundColor = startDownloadButtonHighlightedBackgroundColor 332 | startDownloadButton.nonhighlightedBackgroundColor = startDownloadButtonNonhighlightedBackgroundColor 333 | startDownloadButton.highlightedTitleColor = startDownloadButtonHighlightedTitleColor 334 | startDownloadButton.nonhighlightedTitleColor = startDownloadButtonNonhighlightedTitleColor 335 | } 336 | 337 | private func setUpPendingCircleViewProperties() { 338 | pendingCircleView.circleColor = pendingCircleColor 339 | pendingCircleView.lineWidth = pendingCircleLineWidth 340 | pendingCircleView.alpha = 0 341 | 342 | let tapGesture = UITapGestureRecognizer(target: self, action: #selector(currentButtonTapped)) 343 | pendingCircleView.addGestureRecognizer(tapGesture) 344 | } 345 | 346 | private func setUpDownloadingButtonProperties() { 347 | downloadingButton.highlightedTrackCircleColor = downloadingButtonHighlightedTrackCircleColor 348 | downloadingButton.nonhighlightedTrackCircleColor = downloadingButtonNonhighlightedTrackCircleColor 349 | downloadingButton.highlightedProgressCircleColor = downloadingButtonHighlightedProgressCircleColor 350 | downloadingButton.nonhighlightedProgressCircleColor = downloadingButtonNonhighlightedProgressCircleColor 351 | downloadingButton.highlightedStopViewColor = downloadingButtonHighlightedStopViewColor 352 | downloadingButton.nonhighlightedStopViewColor = downloadingButtonNonhighlightedStopViewColor 353 | downloadingButton.alpha = 0 354 | } 355 | 356 | private func setUpDownloadedButtonProperties() { 357 | downloadedButton.setTitle(downloadedButtonTitle, for: .normal) 358 | downloadedButton.titleLabel?.font = downloadedButtonTitleFont 359 | downloadedButton.highlightedBackgroundColor = downloadedButtonHighlightedBackgroundColor 360 | downloadedButton.nonhighlightedBackgroundColor = downloadedButtonNonhighlightedBackgroundColor 361 | downloadedButton.highlightedTitleColor = downloadedButtonHighlightedTitleColor 362 | downloadedButton.nonhighlightedTitleColor = downloadedButtonNonhighlightedTitleColor 363 | downloadedButton.alpha = 0 364 | } 365 | 366 | // MARK: Constraints setup 367 | 368 | private func setUpStartDownloadButtonConstraints() { 369 | let topConstraint = startDownloadButton.constraint(attribute: .top, toItem: self, toAttribute: .top) 370 | 371 | let bottomConstraint = startDownloadButton.constraint(attribute: .bottom, toItem: self, toAttribute: .bottom) 372 | 373 | let horizontalPositionConstraint = startDownloadButton.constraint(attribute: horizontalAlignmentAttribute, toItem: self, toAttribute: horizontalAlignmentAttribute) 374 | 375 | startDownloadButtonWidthConstraint = startDownloadButton.constraint(attribute: .width, constant: 50) 376 | 377 | NSLayoutConstraint.activate([topConstraint, bottomConstraint, horizontalPositionConstraint, startDownloadButtonWidthConstraint]) 378 | } 379 | 380 | private func setUpPendingButtonConstraints() { 381 | let horizontalPositionConstraint = pendingCircleView.constraint(attribute: horizontalAlignmentAttribute, toItem: self, toAttribute: horizontalAlignmentAttribute) 382 | let heightConstraint = pendingCircleView.constraint(attribute: .height, relation: .equal, toItem: pendingCircleView, toAttribute: .width) 383 | let verticalPositionConstraint = pendingCircleView.constraint(attribute: .centerY, toItem: self, toAttribute: .centerY) 384 | 385 | pendingViewWidthConstraint = pendingCircleView.constraint(attribute: .width, constant: 30) 386 | NSLayoutConstraint.activate([horizontalPositionConstraint, verticalPositionConstraint, heightConstraint, pendingViewWidthConstraint]) 387 | } 388 | 389 | private func setUpDownloadingButtonConstraints() { 390 | let horizontalPositionConstraint = downloadingButton.constraint(attribute: horizontalAlignmentAttribute, toItem: self, toAttribute: horizontalAlignmentAttribute) 391 | let verticalPositionConstraint = downloadingButton.constraint(attribute: .centerY, toItem: self, toAttribute: .centerY) 392 | 393 | let heightConstraint = downloadingButton.constraint(attribute: .height, toItem: downloadingButton, toAttribute: .width) 394 | 395 | downloadingButtonWidthConstraint = downloadingButton.constraint(attribute: .width, constant: 30) 396 | 397 | NSLayoutConstraint.activate([horizontalPositionConstraint, verticalPositionConstraint, heightConstraint, downloadingButtonWidthConstraint]) 398 | } 399 | 400 | private func setUpDownloadedButtonConstraints() { 401 | let topConstraint = downloadedButton.constraint(attribute: .top, toItem: self, toAttribute: .top) 402 | let bottomConstraint = downloadedButton.constraint(attribute: .bottom, toItem: self, toAttribute: .bottom) 403 | let horizontalPositionConstraint = downloadedButton.constraint(attribute: horizontalAlignmentAttribute, toItem: self, toAttribute: horizontalAlignmentAttribute) 404 | 405 | // This constraint will be changed later on (in layoutSubviews), here we're just creating it 406 | downloadedButtonWidthConstraint = downloadedButton.constraint(attribute: .width, constant: 50) 407 | 408 | NSLayoutConstraint.activate([topConstraint, bottomConstraint, horizontalPositionConstraint, downloadedButtonWidthConstraint]) 409 | } 410 | 411 | // MARK: Method overrides 412 | 413 | public override func layoutSubviews() { 414 | super.layoutSubviews() 415 | let width = min(frame.width, frame.height) 416 | pendingViewWidthConstraint.constant = width 417 | downloadingButtonWidthConstraint.constant = width 418 | 419 | if startDownloadButtonTitleWidth == 0 { 420 | startDownloadButtonTitleWidth = startDownloadButton.titleWidth 421 | } 422 | 423 | if downloadedButtonTitleWidth == 0 { 424 | downloadedButtonTitleWidth = downloadedButton.titleWidth 425 | } 426 | } 427 | 428 | // MARK: Action methods 429 | 430 | @objc private func currentButtonTapped() { 431 | delegate?.downloadButton(self, tappedWithState: state) 432 | didTapDownloadButtonAction?(self, state) 433 | } 434 | 435 | } 436 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/CircleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircleView.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | final class CircleView: UIView { 12 | 13 | // MARK: Properties 14 | 15 | var startAngleRadians: CGFloat = -CGFloat.pi / 2 16 | 17 | var endAngleRadians: CGFloat = 3 * CGFloat.pi / 2 18 | 19 | var lineWidth: CGFloat = 1 { 20 | didSet { 21 | circleLayer.lineWidth = lineWidth 22 | } 23 | } 24 | 25 | var circleColor: UIColor = Color.Blue.medium { 26 | didSet { 27 | circleLayer.strokeColor = circleColor.cgColor 28 | } 29 | } 30 | 31 | let circleLayer: CAShapeLayer = { 32 | let layer = CAShapeLayer() 33 | layer.fillColor = UIColor.clear.cgColor 34 | layer.lineCap = .round 35 | return layer 36 | }() 37 | 38 | // MARK: Initializers 39 | 40 | override init(frame: CGRect) { 41 | super.init(frame: frame) 42 | commonInit() 43 | } 44 | 45 | required init?(coder aDecoder: NSCoder) { 46 | super.init(coder: aDecoder) 47 | commonInit() 48 | } 49 | 50 | private func commonInit() { 51 | backgroundColor = .clear 52 | circleLayer.strokeColor = circleColor.cgColor 53 | circleLayer.lineWidth = lineWidth 54 | layer.addSublayer(circleLayer) 55 | } 56 | 57 | override func layoutSubviews() { 58 | super.layoutSubviews() 59 | let radius = min(frame.width / 2, frame.height / 2) - lineWidth / 2 60 | let center = CGPoint(x: frame.width / 2, y: frame.height / 2) 61 | circleLayer.path = UIBezierPath(arcCenter: center, 62 | radius: radius, 63 | startAngle: startAngleRadians, 64 | endAngle: endAngleRadians, 65 | clockwise: true).cgPath 66 | } 67 | 68 | func startSpinning() { 69 | let animationKey = "rotation" 70 | layer.removeAnimation(forKey: animationKey) 71 | let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation") 72 | rotationAnimation.fromValue = 0.0 73 | rotationAnimation.toValue = CGFloat.pi * 2 74 | rotationAnimation.duration = 2 75 | rotationAnimation.repeatCount = .greatestFiniteMagnitude; 76 | layer.add(rotationAnimation, forKey: animationKey) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Color.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 07/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum Color { 12 | 13 | enum Gray { 14 | static let light = UIColor(red: 245.0 / 255.0, green: 244.0 / 255.0, blue: 249.0 / 255.0, alpha: 1) 15 | static let medium = UIColor(red: 238.0 / 255.0, green: 239.0 / 255.0, blue: 245.0 / 255.0, alpha: 1) 16 | static let dark = UIColor(red: 229.0 / 255.0, green: 229.0 / 255.0, blue: 233.0 / 255.0, alpha: 1) 17 | } 18 | 19 | enum Blue { 20 | static let light = UIColor(red: 199.0 / 255.0, green: 222 / 255.0, blue: 243 / 255.0, alpha: 1) 21 | static let medium = UIColor(red: 9.0 / 255.0, green: 111.0 / 255.0, blue: 227.0 / 255.0, alpha: 1) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/HighlightableRoundedButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HighlightableRoundedButton.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | final class HighlightableRoundedButton: UIButton { 12 | 13 | // MARK: Properties 14 | 15 | var highlightedBackgroundColor = Color.Gray.light { 16 | didSet { 17 | updateColors() 18 | } 19 | } 20 | 21 | var nonhighlightedBackgroundColor = Color.Gray.medium { 22 | didSet { 23 | updateColors() 24 | } 25 | } 26 | 27 | var highlightedTitleColor = Color.Blue.light { 28 | didSet { 29 | updateColors() 30 | } 31 | } 32 | 33 | var nonhighlightedTitleColor = Color.Blue.medium { 34 | didSet { 35 | updateColors() 36 | } 37 | } 38 | 39 | override var isHighlighted: Bool { 40 | didSet { 41 | updateColors() 42 | } 43 | } 44 | 45 | // MARK: Initializers 46 | 47 | override init(frame: CGRect) { 48 | super.init(frame: frame) 49 | updateColors() 50 | } 51 | 52 | required init?(coder aDecoder: NSCoder) { 53 | super.init(coder: aDecoder) 54 | updateColors() 55 | } 56 | 57 | // MARK: Helper methods 58 | 59 | private func updateColors() { 60 | backgroundColor = isHighlighted ? highlightedBackgroundColor : nonhighlightedBackgroundColor 61 | let titleColor = isHighlighted ? highlightedTitleColor : nonhighlightedTitleColor 62 | setTitleColor(titleColor, for: .normal) 63 | } 64 | 65 | override func layoutSubviews() { 66 | super.layoutSubviews() 67 | layer.cornerRadius = frame.height / 2 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/ProgressButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressButton.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | final class ProgressButton: UIControl { 12 | 13 | // MARK: Properties 14 | 15 | var circleViewLineWidth: CGFloat = 6 { 16 | didSet { 17 | progressCircleView.lineWidth = circleViewLineWidth 18 | trackCircleView.lineWidth = circleViewLineWidth 19 | } 20 | } 21 | 22 | let stopView: UIView = { 23 | let view = UIView() 24 | view.isUserInteractionEnabled = false 25 | view.layer.cornerRadius = 3 26 | return view 27 | }() 28 | 29 | lazy var trackCircleView: CircleView = { 30 | let circleView = CircleView() 31 | circleView.lineWidth = circleViewLineWidth 32 | circleView.isUserInteractionEnabled = false 33 | return circleView 34 | }() 35 | 36 | lazy var progressCircleView: ProgressCircleView = { 37 | let view = ProgressCircleView() 38 | view.lineWidth = circleViewLineWidth 39 | view.isUserInteractionEnabled = false 40 | return view 41 | }() 42 | 43 | var nonhighlightedTrackCircleColor: UIColor = Color.Gray.medium { 44 | didSet { 45 | updateColors() 46 | } 47 | } 48 | 49 | var highlightedTrackCircleColor: UIColor = Color.Gray.light { 50 | didSet { 51 | updateColors() 52 | } 53 | } 54 | 55 | var nonhighlightedProgressCircleColor: UIColor = Color.Blue.medium { 56 | didSet { 57 | updateColors() 58 | } 59 | } 60 | 61 | var highlightedProgressCircleColor: UIColor = Color.Blue.light { 62 | didSet { 63 | updateColors() 64 | } 65 | } 66 | 67 | var nonhighlightedStopViewColor: UIColor = Color.Blue.medium { 68 | didSet { 69 | updateColors() 70 | } 71 | } 72 | 73 | var highlightedStopViewColor: UIColor = Color.Blue.light { 74 | didSet { 75 | updateColors() 76 | } 77 | } 78 | 79 | var progress: CGFloat = 0 { 80 | didSet { 81 | if progress < 0 { 82 | progress = 0 83 | } else if progress > 1 { 84 | progress = 1 85 | } 86 | progressCircleView.progress = progress 87 | } 88 | } 89 | 90 | var stopButtonCornerRadius: CGFloat = 3 { 91 | didSet { 92 | stopView.layer.cornerRadius = stopButtonCornerRadius 93 | } 94 | } 95 | 96 | override var isHighlighted: Bool { 97 | didSet { 98 | updateColors() 99 | } 100 | } 101 | 102 | // MARK: Initializers 103 | 104 | override init(frame: CGRect) { 105 | super.init(frame: frame) 106 | commonInit() 107 | } 108 | 109 | required init?(coder aDecoder: NSCoder) { 110 | super.init(coder: aDecoder) 111 | commonInit() 112 | } 113 | 114 | // MARK: Helper methods 115 | 116 | private func commonInit() { 117 | backgroundColor = .clear 118 | 119 | addSubview(trackCircleView) 120 | trackCircleView.pinToSuperview() 121 | 122 | addSubview(progressCircleView) 123 | progressCircleView.pinToSuperview() 124 | 125 | addSubview(stopView) 126 | stopView.centerToSuperview() 127 | let heightConstraint = stopView.constraint(attribute: .height, toItem: stopView, toAttribute: .width) 128 | let widthConstraint = stopView.constraint(attribute: .width, toItem: self, toAttribute: .width, multiplier: 0.3, constant: 0) 129 | 130 | NSLayoutConstraint.activate([heightConstraint, widthConstraint]) 131 | updateColors() 132 | } 133 | 134 | private func updateColors() { 135 | trackCircleView.circleColor = isHighlighted ? highlightedTrackCircleColor : nonhighlightedTrackCircleColor 136 | progressCircleView.circleColor = isHighlighted ? highlightedProgressCircleColor : nonhighlightedProgressCircleColor 137 | stopView.backgroundColor = isHighlighted ? highlightedStopViewColor : nonhighlightedStopViewColor 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/ProgressCircleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressCircleView.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 17/09/2018. 6 | // 7 | 8 | import UIKit 9 | 10 | final class ProgressCircleView: UIView { 11 | 12 | // MARK: Properties 13 | 14 | private let circleView: CircleView = { 15 | let view = CircleView() 16 | view.circleColor = .red 17 | view.startAngleRadians = -CGFloat.pi / 2 18 | view.endAngleRadians = view.startAngleRadians + 2 * .pi 19 | return view 20 | }() 21 | 22 | private var isAnimating = false 23 | 24 | var progressAnimationDuration: TimeInterval = 0.3 25 | 26 | var progress: CGFloat = 0 { 27 | didSet { 28 | if progress == 1 && isAnimating { 29 | if let currentAnimatedProgress = circleView.circleLayer.presentation()?.strokeEnd { 30 | circleView.circleLayer.strokeEnd = currentAnimatedProgress 31 | animateProgress(from: currentAnimatedProgress, to: progress) 32 | } 33 | } 34 | 35 | guard !isAnimating else { return } 36 | animateProgress(from: circleView.circleLayer.strokeEnd, to: progress) 37 | } 38 | } 39 | 40 | var lineWidth: CGFloat = 1 { 41 | didSet { 42 | circleView.lineWidth = lineWidth 43 | } 44 | } 45 | 46 | var circleColor: UIColor = Color.Blue.medium { 47 | didSet { 48 | circleView.circleLayer.strokeColor = circleColor.cgColor 49 | } 50 | } 51 | 52 | // MARK: Initializers 53 | 54 | override init(frame: CGRect) { 55 | super.init(frame: frame) 56 | commonInit() 57 | } 58 | 59 | required init?(coder aDecoder: NSCoder) { 60 | super.init(coder: aDecoder) 61 | commonInit() 62 | } 63 | 64 | private func commonInit() { 65 | addSubview(circleView) 66 | circleView.pinToSuperview() 67 | } 68 | 69 | private func animateProgress(from startValue: CGFloat, to endValue: CGFloat) { 70 | isAnimating = true 71 | circleView.circleLayer.strokeEnd = endValue 72 | let animation = CABasicAnimation(keyPath: "strokeEnd") 73 | animation.timingFunction = CAMediaTimingFunction(name: .easeOut) 74 | animation.fromValue = startValue 75 | animation.duration = progressAnimationDuration 76 | animation.delegate = self 77 | circleView.circleLayer.add(animation, forKey: nil) 78 | } 79 | } 80 | 81 | extension ProgressCircleView: CAAnimationDelegate { 82 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 83 | isAnimating = false 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/UIButton+TitleWidth.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+TitleWidth.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIButton { 12 | 13 | var titleWidth: CGFloat { 14 | guard let text = titleLabel?.text, let font = titleLabel?.font else { return 0 } 15 | return text.size(withAttributes: [.font: font]).width 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Sources/AHDownloadButton/Classes/UIView+Constraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Constraint.swift 3 | // AHDownloadButton 4 | // 5 | // Created by Amer Hukic on 03/09/2018. 6 | // Copyright © 2018 Amer Hukic. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | 13 | @discardableResult 14 | func constraint(attribute: NSLayoutConstraint.Attribute, relation: NSLayoutConstraint.Relation = .equal, toItem: Any? = nil, toAttribute: NSLayoutConstraint.Attribute = .notAnAttribute, multiplier: CGFloat = 1, constant: CGFloat = 0) -> NSLayoutConstraint { 15 | translatesAutoresizingMaskIntoConstraints = false 16 | let constraint = NSLayoutConstraint(item: self, 17 | attribute: attribute, 18 | relatedBy: relation, 19 | toItem: toItem, 20 | attribute: toAttribute, 21 | multiplier: multiplier, 22 | constant: constant) 23 | return constraint 24 | } 25 | 26 | func pinToSuperview() { 27 | translatesAutoresizingMaskIntoConstraints = false 28 | let topConstraint = self.constraint(attribute: .top, toItem: superview, toAttribute: .top) 29 | let bottomConstraint = self.constraint(attribute: .bottom, toItem: superview, toAttribute: .bottom) 30 | let leadingConstraint = constraint(attribute: .leading, toItem: superview, toAttribute: .leading) 31 | let trailingConstraint = self.constraint(attribute: .trailing, toItem: superview, toAttribute: .trailing) 32 | NSLayoutConstraint.activate([trailingConstraint, topConstraint, leadingConstraint, bottomConstraint]) 33 | } 34 | 35 | func centerToSuperview() { 36 | translatesAutoresizingMaskIntoConstraints = false 37 | let centerXConstraint = constraint(attribute: .centerX, toItem: superview, toAttribute: .centerX) 38 | 39 | let centerYConstraint = constraint(attribute: .centerY, toItem: superview, toAttribute: .centerY) 40 | NSLayoutConstraint.activate([centerXConstraint, centerYConstraint]) 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /carthage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # carthage.sh 4 | # Usage example: ./carthage.sh build --platform iOS 5 | 6 | set -euo pipefail 7 | 8 | xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) 9 | trap 'rm -f "$xcconfig"' INT TERM HUP EXIT 10 | 11 | # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise 12 | # the build will fail on lipo due to duplicate architectures. 13 | 14 | CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) 15 | echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig 16 | 17 | echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig 18 | echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig 19 | 20 | export XCODE_XCCONFIG_FILE="$xcconfig" 21 | carthage "$@" 22 | --------------------------------------------------------------------------------