├── .gitignore ├── .swift-version ├── .travis.yml ├── Example ├── MMUploadImage.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── MMUploadImage-Example.xcscheme ├── MMUploadImage.xcworkspace │ └── contents.xcworkspacedata ├── MMUploadImage │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── app_icon_60.imageset │ │ │ ├── Contents.json │ │ │ ├── app_icon_60@2x.png │ │ │ └── app_icon_60@3x.png │ │ └── img_member_photo.imageset │ │ │ ├── Contents.json │ │ │ ├── img_member_photo.png │ │ │ ├── img_member_photo@2x.png │ │ │ └── img_member_photo@3x.png │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── MMUploadImage.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── MMUploadImage │ │ ├── Info.plist │ │ ├── MMUploadImage-dummy.m │ │ ├── MMUploadImage-prefix.pch │ │ ├── MMUploadImage-umbrella.h │ │ ├── MMUploadImage.modulemap │ │ └── MMUploadImage.xcconfig │ │ └── Pods-MMUploadImage_Example │ │ ├── Info.plist │ │ ├── Pods-MMUploadImage_Example-acknowledgements.markdown │ │ ├── Pods-MMUploadImage_Example-acknowledgements.plist │ │ ├── Pods-MMUploadImage_Example-dummy.m │ │ ├── Pods-MMUploadImage_Example-frameworks.sh │ │ ├── Pods-MMUploadImage_Example-resources.sh │ │ ├── Pods-MMUploadImage_Example-umbrella.h │ │ ├── Pods-MMUploadImage_Example.debug.xcconfig │ │ ├── Pods-MMUploadImage_Example.modulemap │ │ └── Pods-MMUploadImage_Example.release.xcconfig └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── MMUploadImage.podspec ├── MMUploadImage ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── ButtonExtenstion.swift │ ├── MMImageUpload.swift │ └── WaveObject.swift ├── README.md ├── RoundMid.gif ├── _Pods.xcodeproj ├── midscreen.gif └── wave.gif /.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 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0-GM-CANDIDATE 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -workspace Example/MMUploadImage.xcworkspace -scheme MMUploadImage-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/MMUploadImage.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1AF23B667983D9842283A303 /* Pods_MMUploadImage_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 236BC5B7BBC18699BE354D9F /* Pods_MMUploadImage_Example.framework */; }; 11 | 2707A1351D4B723D008BD4BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2707A1341D4B723D008BD4BC /* Assets.xcassets */; }; 12 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 13 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 14 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 15 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 16 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 25 | remoteInfo = MMUploadImage; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 034D9E5AE28093BE276578EE /* Pods-MMUploadImage_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MMUploadImage_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.release.xcconfig"; sourceTree = ""; }; 31 | 1F085A97C705DEBDC1A9BABC /* MMUploadImage.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MMUploadImage.podspec; path = ../MMUploadImage.podspec; sourceTree = ""; }; 32 | 236BC5B7BBC18699BE354D9F /* Pods_MMUploadImage_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MMUploadImage_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 2707A1341D4B723D008BD4BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | 40896E16BB9B5D841318BA21 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 35 | 607FACD01AFB9204008FA782 /* MMUploadImage_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MMUploadImage_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 39 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | 607FACE51AFB9204008FA782 /* MMUploadImage_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MMUploadImage_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 44 | B5A354BB3B320F939D523A9B /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 45 | FDDB4906196E5BD161A8DE3F /* Pods-MMUploadImage_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MMUploadImage_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.debug.xcconfig"; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 1AF23B667983D9842283A303 /* Pods_MMUploadImage_Example.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 607FACC71AFB9204008FA782 = { 68 | isa = PBXGroup; 69 | children = ( 70 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 71 | 607FACD21AFB9204008FA782 /* Example for MMUploadImage */, 72 | 607FACE81AFB9204008FA782 /* Tests */, 73 | 607FACD11AFB9204008FA782 /* Products */, 74 | F2E27F4C628BF195107FAE0A /* Pods */, 75 | 9D1E175CA9C082A6EF1C9336 /* Frameworks */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | 607FACD11AFB9204008FA782 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 607FACD01AFB9204008FA782 /* MMUploadImage_Example.app */, 83 | 607FACE51AFB9204008FA782 /* MMUploadImage_Tests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | 607FACD21AFB9204008FA782 /* Example for MMUploadImage */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 92 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 93 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 94 | 2707A1341D4B723D008BD4BC /* Assets.xcassets */, 95 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 96 | 607FACD31AFB9204008FA782 /* Supporting Files */, 97 | ); 98 | name = "Example for MMUploadImage"; 99 | path = MMUploadImage; 100 | sourceTree = ""; 101 | }; 102 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 607FACD41AFB9204008FA782 /* Info.plist */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | 607FACE81AFB9204008FA782 /* Tests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 114 | 607FACE91AFB9204008FA782 /* Supporting Files */, 115 | ); 116 | path = Tests; 117 | sourceTree = ""; 118 | }; 119 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 607FACEA1AFB9204008FA782 /* Info.plist */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 1F085A97C705DEBDC1A9BABC /* MMUploadImage.podspec */, 131 | B5A354BB3B320F939D523A9B /* README.md */, 132 | 40896E16BB9B5D841318BA21 /* LICENSE */, 133 | ); 134 | name = "Podspec Metadata"; 135 | sourceTree = ""; 136 | }; 137 | 9D1E175CA9C082A6EF1C9336 /* Frameworks */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 236BC5B7BBC18699BE354D9F /* Pods_MMUploadImage_Example.framework */, 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | F2E27F4C628BF195107FAE0A /* Pods */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | FDDB4906196E5BD161A8DE3F /* Pods-MMUploadImage_Example.debug.xcconfig */, 149 | 034D9E5AE28093BE276578EE /* Pods-MMUploadImage_Example.release.xcconfig */, 150 | ); 151 | name = Pods; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXGroup section */ 155 | 156 | /* Begin PBXNativeTarget section */ 157 | 607FACCF1AFB9204008FA782 /* MMUploadImage_Example */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MMUploadImage_Example" */; 160 | buildPhases = ( 161 | 8D68142A4E57824BE9BF08C9 /* [CP] Check Pods Manifest.lock */, 162 | 607FACCC1AFB9204008FA782 /* Sources */, 163 | 607FACCD1AFB9204008FA782 /* Frameworks */, 164 | 607FACCE1AFB9204008FA782 /* Resources */, 165 | ED895EF8E9555473ADCE1B2A /* [CP] Embed Pods Frameworks */, 166 | 8E28F6787D9A6C6F32069594 /* [CP] Copy Pods Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = MMUploadImage_Example; 173 | productName = MMUploadImage; 174 | productReference = 607FACD01AFB9204008FA782 /* MMUploadImage_Example.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | 607FACE41AFB9204008FA782 /* MMUploadImage_Tests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MMUploadImage_Tests" */; 180 | buildPhases = ( 181 | 607FACE11AFB9204008FA782 /* Sources */, 182 | 607FACE21AFB9204008FA782 /* Frameworks */, 183 | 607FACE31AFB9204008FA782 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 189 | ); 190 | name = MMUploadImage_Tests; 191 | productName = Tests; 192 | productReference = 607FACE51AFB9204008FA782 /* MMUploadImage_Tests.xctest */; 193 | productType = "com.apple.product-type.bundle.unit-test"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | 607FACC81AFB9204008FA782 /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0720; 202 | LastUpgradeCheck = 0800; 203 | ORGANIZATIONNAME = CocoaPods; 204 | TargetAttributes = { 205 | 607FACCF1AFB9204008FA782 = { 206 | CreatedOnToolsVersion = 6.3.1; 207 | LastSwiftMigration = 0800; 208 | }; 209 | 607FACE41AFB9204008FA782 = { 210 | CreatedOnToolsVersion = 6.3.1; 211 | LastSwiftMigration = 0800; 212 | TestTargetID = 607FACCF1AFB9204008FA782; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MMUploadImage" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 607FACC71AFB9204008FA782; 225 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 607FACCF1AFB9204008FA782 /* MMUploadImage_Example */, 230 | 607FACE41AFB9204008FA782 /* MMUploadImage_Tests */, 231 | ); 232 | }; 233 | /* End PBXProject section */ 234 | 235 | /* Begin PBXResourcesBuildPhase section */ 236 | 607FACCE1AFB9204008FA782 /* Resources */ = { 237 | isa = PBXResourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 241 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 242 | 2707A1351D4B723D008BD4BC /* Assets.xcassets in Resources */, 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | 607FACE31AFB9204008FA782 /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXResourcesBuildPhase section */ 254 | 255 | /* Begin PBXShellScriptBuildPhase section */ 256 | 8D68142A4E57824BE9BF08C9 /* [CP] Check Pods Manifest.lock */ = { 257 | isa = PBXShellScriptBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | ); 261 | inputPaths = ( 262 | ); 263 | name = "[CP] Check Pods Manifest.lock"; 264 | outputPaths = ( 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | shellPath = /bin/sh; 268 | shellScript = "diff \"${PODS_ROOT}/../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"; 269 | showEnvVarsInLog = 0; 270 | }; 271 | 8E28F6787D9A6C6F32069594 /* [CP] Copy Pods Resources */ = { 272 | isa = PBXShellScriptBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | inputPaths = ( 277 | ); 278 | name = "[CP] Copy Pods Resources"; 279 | outputPaths = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | shellPath = /bin/sh; 283 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example-resources.sh\"\n"; 284 | showEnvVarsInLog = 0; 285 | }; 286 | ED895EF8E9555473ADCE1B2A /* [CP] Embed Pods Frameworks */ = { 287 | isa = PBXShellScriptBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | inputPaths = ( 292 | ); 293 | name = "[CP] Embed Pods Frameworks"; 294 | outputPaths = ( 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | shellPath = /bin/sh; 298 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example-frameworks.sh\"\n"; 299 | showEnvVarsInLog = 0; 300 | }; 301 | /* End PBXShellScriptBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | 607FACCC1AFB9204008FA782 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 309 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | 607FACE11AFB9204008FA782 /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXSourcesBuildPhase section */ 322 | 323 | /* Begin PBXTargetDependency section */ 324 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 325 | isa = PBXTargetDependency; 326 | target = 607FACCF1AFB9204008FA782 /* MMUploadImage_Example */; 327 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 328 | }; 329 | /* End PBXTargetDependency section */ 330 | 331 | /* Begin PBXVariantGroup section */ 332 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 607FACDA1AFB9204008FA782 /* Base */, 336 | ); 337 | name = Main.storyboard; 338 | sourceTree = ""; 339 | }; 340 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 607FACDF1AFB9204008FA782 /* Base */, 344 | ); 345 | name = LaunchScreen.xib; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 607FACED1AFB9204008FA782 /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INFINITE_RECURSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 368 | CLANG_WARN_UNREACHABLE_CODE = YES; 369 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 370 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 371 | COPY_PHASE_STRIP = NO; 372 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | ENABLE_TESTABILITY = YES; 375 | GCC_C_LANGUAGE_STANDARD = gnu99; 376 | GCC_DYNAMIC_NO_PIC = NO; 377 | GCC_NO_COMMON_BLOCKS = YES; 378 | GCC_OPTIMIZATION_LEVEL = 0; 379 | GCC_PREPROCESSOR_DEFINITIONS = ( 380 | "DEBUG=1", 381 | "$(inherited)", 382 | ); 383 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 391 | MTL_ENABLE_DEBUG_INFO = YES; 392 | ONLY_ACTIVE_ARCH = YES; 393 | SDKROOT = iphoneos; 394 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 395 | }; 396 | name = Debug; 397 | }; 398 | 607FACEE1AFB9204008FA782 /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ALWAYS_SEARCH_USER_PATHS = NO; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_EMPTY_BODY = YES; 410 | CLANG_WARN_ENUM_CONVERSION = YES; 411 | CLANG_WARN_INFINITE_RECURSION = YES; 412 | CLANG_WARN_INT_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 607FACF01AFB9204008FA782 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = FDDB4906196E5BD161A8DE3F /* Pods-MMUploadImage_Example.debug.xcconfig */; 441 | buildSettings = { 442 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CODE_SIGN_IDENTITY = "iPhone Developer"; 445 | INFOPLIST_FILE = MMUploadImage/Info.plist; 446 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 448 | MODULE_NAME = ExampleApp; 449 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | SWIFT_VERSION = 3.0; 452 | }; 453 | name = Debug; 454 | }; 455 | 607FACF11AFB9204008FA782 /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | baseConfigurationReference = 034D9E5AE28093BE276578EE /* Pods-MMUploadImage_Example.release.xcconfig */; 458 | buildSettings = { 459 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | CODE_SIGN_IDENTITY = "iPhone Developer"; 462 | INFOPLIST_FILE = MMUploadImage/Info.plist; 463 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 465 | MODULE_NAME = ExampleApp; 466 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | SWIFT_VERSION = 3.0; 469 | }; 470 | name = Release; 471 | }; 472 | 607FACF31AFB9204008FA782 /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | FRAMEWORK_SEARCH_PATHS = ( 476 | "$(SDKROOT)/Developer/Library/Frameworks", 477 | "$(inherited)", 478 | ); 479 | GCC_PREPROCESSOR_DEFINITIONS = ( 480 | "DEBUG=1", 481 | "$(inherited)", 482 | ); 483 | INFOPLIST_FILE = Tests/Info.plist; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | SWIFT_VERSION = 3.0; 488 | }; 489 | name = Debug; 490 | }; 491 | 607FACF41AFB9204008FA782 /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | FRAMEWORK_SEARCH_PATHS = ( 495 | "$(SDKROOT)/Developer/Library/Frameworks", 496 | "$(inherited)", 497 | ); 498 | INFOPLIST_FILE = Tests/Info.plist; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | SWIFT_VERSION = 3.0; 503 | }; 504 | name = Release; 505 | }; 506 | /* End XCBuildConfiguration section */ 507 | 508 | /* Begin XCConfigurationList section */ 509 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MMUploadImage" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 607FACED1AFB9204008FA782 /* Debug */, 513 | 607FACEE1AFB9204008FA782 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MMUploadImage_Example" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | 607FACF01AFB9204008FA782 /* Debug */, 522 | 607FACF11AFB9204008FA782 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MMUploadImage_Tests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 607FACF31AFB9204008FA782 /* Debug */, 531 | 607FACF41AFB9204008FA782 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 539 | } 540 | -------------------------------------------------------------------------------- /Example/MMUploadImage.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/MMUploadImage.xcodeproj/xcshareddata/xcschemes/MMUploadImage-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/MMUploadImage.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/MMUploadImage/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ImageExtensionTest 4 | // 5 | // Created by MILLMAN on 2016/7/7. 6 | // Copyright © 2016年 MILLMAN. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/app_icon_60.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "app_icon_60@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "app_icon_60@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/app_icon_60.imageset/app_icon_60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/Example/MMUploadImage/Assets.xcassets/app_icon_60.imageset/app_icon_60@2x.png -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/app_icon_60.imageset/app_icon_60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/Example/MMUploadImage/Assets.xcassets/app_icon_60.imageset/app_icon_60@3x.png -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "img_member_photo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "img_member_photo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "img_member_photo@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo.png -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo@2x.png -------------------------------------------------------------------------------- /Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/Example/MMUploadImage/Assets.xcassets/img_member_photo.imageset/img_member_photo@3x.png -------------------------------------------------------------------------------- /Example/MMUploadImage/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/MMUploadImage/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 48 | 58 | 69 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /Example/MMUploadImage/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 | NSCameraUsageDescription 26 | Please check 27 | NSContactsUsageDescription 28 | Please check exist 29 | NSPhotoLibraryUsageDescription 30 | Please check 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | UIMainStoryboardFile 34 | Main 35 | UIRequiredDeviceCapabilities 36 | 37 | armv7 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationLandscapeLeft 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/MMUploadImage/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ImageExtensionTest 4 | // 5 | // Created by MILLMAN on 2016/7/7. 6 | // Copyright © 2016年 MILLMAN. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import MMUploadImage 11 | class ViewController: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate { 12 | 13 | @IBOutlet weak var imgView:UIImageView! 14 | @IBOutlet weak var seg:UISegmentedControl! 15 | 16 | var progress:Float = 0.0 17 | lazy var selectImage:UIImage = { 18 | let img = UIImage.init(named: "app_icon_60")! 19 | return img 20 | }() 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | seg.selectedSegmentIndex = 0 24 | 25 | self.imgView.completedBlock = { 26 | print("Upload image Finish") 27 | } 28 | 29 | self.imgView.failBlock = { 30 | print("Upload image Fail") 31 | } 32 | } 33 | 34 | func reset() { 35 | self.imgView.uploadImage(image:selectImage, progress: progress) 36 | if(progress <= 1.0) { 37 | self.perform(#selector(ViewController.reset), with: nil, afterDelay: 0.3) 38 | } 39 | progress += 0.1 40 | 41 | } 42 | 43 | @IBAction func autoAddAction () { 44 | 45 | if progress == 1.0 { 46 | progress = 0.0 47 | } 48 | 49 | progress = (progress + 0.14 <= 1.0) ? progress + 0.14 : 1.0 50 | self.reset() 51 | self.imgView.autoCompleted = true 52 | } 53 | 54 | @IBAction func faileAction (){ 55 | progress = 0.0 56 | self.imgView.uploadImageFail() 57 | } 58 | 59 | @IBAction func addAction() { 60 | progress = (progress + 0.14 <= 1.0) ? progress + 0.14 : 1.0 61 | self.imgView.uploadImage(image:selectImage, progress: progress) 62 | } 63 | 64 | @IBAction func completedAction () { 65 | self.imgView.uploadCompleted() 66 | } 67 | 68 | @IBAction func selectImageAction () { 69 | let picker = UIImagePickerController() 70 | picker.delegate = self 71 | picker.allowsEditing = true 72 | picker.sourceType = .photoLibrary 73 | picker.videoQuality = .typeLow; 74 | self.present(picker, animated: true, completion: nil) 75 | } 76 | 77 | @IBAction func segmentAction(_ segment:UISegmentedControl) { 78 | progress = 0.0 79 | self.imgView.uploadImageFail() 80 | switch segment.selectedSegmentIndex { 81 | case 0: 82 | imgView.style = .sector 83 | case 1: 84 | imgView.style = .centerExpand 85 | case 2: 86 | imgView.style = .centerShrink 87 | case 3: 88 | imgView.style = .roundWith(lineWdith: 5, lineColor: UIColor.yellow) 89 | case 4: 90 | imgView.style = .wave 91 | default:break 92 | } 93 | } 94 | 95 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 96 | if let img = info[UIImagePickerControllerEditedImage] as? UIImage { 97 | self.progress = 0.1 98 | self.selectImage = img 99 | self.imgView.uploadImage(image:selectImage, progress: progress) 100 | } 101 | picker.dismiss(animated: true, completion: nil) 102 | } 103 | 104 | override func didReceiveMemoryWarning() { 105 | super.didReceiveMemoryWarning() 106 | // Dispose of any resources that can be recreated. 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'MMUploadImage_Example' do 4 | pod 'MMUploadImage', :path => '../' 5 | end 6 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MMUploadImage (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - MMUploadImage (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | MMUploadImage: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | MMUploadImage: ac501d1b77b85093edec7d9a4922daee5cf514d2 13 | 14 | PODFILE CHECKSUM: 22c43a2fe9f7be3e39d15615c6a229ebfb2c1bad 15 | 16 | COCOAPODS: 1.1.0.rc.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/MMUploadImage.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MMUploadImage", 3 | "version": "2.0.4", 4 | "summary": "MMUploadImage", 5 | "description": "Its a Extension helper for UIImageView to Upload a image when post to server", 6 | "homepage": "https://github.com/MillmanY/UploadImage", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Millman": "millmanyang@gmail.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/MillmanY/UploadImage.git", 16 | "tag": "2.0.4" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "MMUploadImage/Classes/**/*", 22 | "frameworks": "UIKit", 23 | "requires_arc": true 24 | } 25 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MMUploadImage (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - MMUploadImage (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | MMUploadImage: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | MMUploadImage: ac501d1b77b85093edec7d9a4922daee5cf514d2 13 | 14 | PODFILE CHECKSUM: 22c43a2fe9f7be3e39d15615c6a229ebfb2c1bad 15 | 16 | COCOAPODS: 1.1.0.rc.1 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 | 0D616069D2E5C166E893B94A1303B784 /* MMUploadImage-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 900FFBD6CFF84CEC38625ADD621D84A2 /* MMUploadImage-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 28CE6F23CB03AA6D64A378D85ADCDCFD /* Pods-MMUploadImage_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 849C36E4EE09D4DF014BD1139C8C843B /* Pods-MMUploadImage_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 2F7FA0D61DAB74805BDE70C4D6A6B698 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E86668F20F252C440D1015B816BE59C5 /* UIKit.framework */; }; 13 | 3A5EF4634ED58E93D405B46C05418880 /* Pods-MMUploadImage_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F5BD20BAA2510222643C237D46A8411C /* Pods-MMUploadImage_Example-dummy.m */; }; 14 | 3F871929EDE0E92D2EF5494C37064933 /* MMImageUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E85597146585268A79255C7096E69A2 /* MMImageUpload.swift */; }; 15 | 51C4CB96258DEF9BFDA210A31D5389B7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2A6FF208CEC4C2861F1E9D42D651453 /* Foundation.framework */; }; 16 | 6577414078C658B8D943678255D9D48C /* MMUploadImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C14D7A56DCDD32EE64C3307345EA081 /* MMUploadImage-dummy.m */; }; 17 | DB8C1EF9A2D0B3F8DDCE4EDB5403E8AE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2A6FF208CEC4C2861F1E9D42D651453 /* Foundation.framework */; }; 18 | F80A01767061B2ECE2E5DA9D6608ACFE /* ButtonExtenstion.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE3EB3E7AB2F36C9D6213A33BF31A80B /* ButtonExtenstion.swift */; }; 19 | FA55E3356DDB8781B77915723905DC7F /* WaveObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0597C0BD58FD0176FD08A3F72A91CE76 /* WaveObject.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 5A1D1EFF09EA5BAA0D23EDAAEDDF8DDA /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 298A80ADD37290BF472C97F179113DCF; 28 | remoteInfo = MMUploadImage; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 0597C0BD58FD0176FD08A3F72A91CE76 /* WaveObject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WaveObject.swift; sourceTree = ""; }; 34 | 16FC04523F28A0337DCCBA39EA13BEAA /* Pods_MMUploadImage_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MMUploadImage_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 237F9C681513A0A580C85B9BBE6DD926 /* Pods-MMUploadImage_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MMUploadImage_Example.release.xcconfig"; sourceTree = ""; }; 36 | 36D490A7386BFB404C9229E2D65AFA55 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 3BC50D65ACA0DCB4CABD21496F6C1EFF /* Pods-MMUploadImage_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MMUploadImage_Example-frameworks.sh"; sourceTree = ""; }; 38 | 3C14D7A56DCDD32EE64C3307345EA081 /* MMUploadImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MMUploadImage-dummy.m"; sourceTree = ""; }; 39 | 3C5C2A3B83AB929961B3D685EAAAFE80 /* MMUploadImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MMUploadImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 3E85597146585268A79255C7096E69A2 /* MMImageUpload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MMImageUpload.swift; sourceTree = ""; }; 41 | 7AEA6F025AF1B6608707805013942EB4 /* MMUploadImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MMUploadImage-prefix.pch"; sourceTree = ""; }; 42 | 7DC4F75CD54915E4B9C005DEB8B534C8 /* Pods-MMUploadImage_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MMUploadImage_Example-resources.sh"; sourceTree = ""; }; 43 | 849C36E4EE09D4DF014BD1139C8C843B /* Pods-MMUploadImage_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MMUploadImage_Example-umbrella.h"; sourceTree = ""; }; 44 | 8831952DC3A9B37C8A11A3349A298077 /* MMUploadImage.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = MMUploadImage.modulemap; sourceTree = ""; }; 45 | 8AA2105B777A49ECBA03A54DD9E892C9 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 900FFBD6CFF84CEC38625ADD621D84A2 /* MMUploadImage-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MMUploadImage-umbrella.h"; sourceTree = ""; }; 47 | 914B7C84064AB60AAE882A21AB067A48 /* Pods-MMUploadImage_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MMUploadImage_Example.debug.xcconfig"; sourceTree = ""; }; 48 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 49 | A2A6FF208CEC4C2861F1E9D42D651453 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 50 | A37E7B75D33D39E23403E669E31E635F /* Pods-MMUploadImage_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MMUploadImage_Example-acknowledgements.markdown"; sourceTree = ""; }; 51 | B7B4FFFC2573A324606EE5D3E3456EAB /* Pods-MMUploadImage_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MMUploadImage_Example-acknowledgements.plist"; sourceTree = ""; }; 52 | BD7D3F974C9485348A56176F0F467B76 /* MMUploadImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MMUploadImage.xcconfig; sourceTree = ""; }; 53 | E86668F20F252C440D1015B816BE59C5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 54 | EE3EB3E7AB2F36C9D6213A33BF31A80B /* ButtonExtenstion.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ButtonExtenstion.swift; sourceTree = ""; }; 55 | F5BD20BAA2510222643C237D46A8411C /* Pods-MMUploadImage_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MMUploadImage_Example-dummy.m"; sourceTree = ""; }; 56 | FD134F61630CCB68AEBB40F404A82C03 /* Pods-MMUploadImage_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-MMUploadImage_Example.modulemap"; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 06ACB1BDBCFF39A0C8D6031E82A2EB62 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | DB8C1EF9A2D0B3F8DDCE4EDB5403E8AE /* Foundation.framework in Frameworks */, 65 | 2F7FA0D61DAB74805BDE70C4D6A6B698 /* UIKit.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | DE2BB65FF8C8D00B489BEEA4A6BB8A21 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | 51C4CB96258DEF9BFDA210A31D5389B7 /* Foundation.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 3007ECA9D03ECD63745C252131F3FB3A /* Support Files */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 8AA2105B777A49ECBA03A54DD9E892C9 /* Info.plist */, 84 | 8831952DC3A9B37C8A11A3349A298077 /* MMUploadImage.modulemap */, 85 | BD7D3F974C9485348A56176F0F467B76 /* MMUploadImage.xcconfig */, 86 | 3C14D7A56DCDD32EE64C3307345EA081 /* MMUploadImage-dummy.m */, 87 | 7AEA6F025AF1B6608707805013942EB4 /* MMUploadImage-prefix.pch */, 88 | 900FFBD6CFF84CEC38625ADD621D84A2 /* MMUploadImage-umbrella.h */, 89 | ); 90 | name = "Support Files"; 91 | path = "Example/Pods/Target Support Files/MMUploadImage"; 92 | sourceTree = ""; 93 | }; 94 | 33F58AAB392A4654BD38A1B5BE6706DF /* Classes */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | EE3EB3E7AB2F36C9D6213A33BF31A80B /* ButtonExtenstion.swift */, 98 | 3E85597146585268A79255C7096E69A2 /* MMImageUpload.swift */, 99 | 0597C0BD58FD0176FD08A3F72A91CE76 /* WaveObject.swift */, 100 | ); 101 | path = Classes; 102 | sourceTree = ""; 103 | }; 104 | 433CD3331B6C3787F473C941B61FC68F /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | F302CD3B306AF1ED96B9AF31FCDBC26C /* iOS */, 108 | ); 109 | name = Frameworks; 110 | sourceTree = ""; 111 | }; 112 | 5042B64E98817ABDEDFDDAA02901A369 /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 3C5C2A3B83AB929961B3D685EAAAFE80 /* MMUploadImage.framework */, 116 | 16FC04523F28A0337DCCBA39EA13BEAA /* Pods_MMUploadImage_Example.framework */, 117 | ); 118 | name = Products; 119 | sourceTree = ""; 120 | }; 121 | 7DB346D0F39D3F0E887471402A8071AB = { 122 | isa = PBXGroup; 123 | children = ( 124 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 125 | BA9400C62483075526EF2D5E4E134E87 /* Development Pods */, 126 | 433CD3331B6C3787F473C941B61FC68F /* Frameworks */, 127 | 5042B64E98817ABDEDFDDAA02901A369 /* Products */, 128 | 9061C4E26285A1DC049FA8D70778797A /* Targets Support Files */, 129 | ); 130 | sourceTree = ""; 131 | }; 132 | 9061C4E26285A1DC049FA8D70778797A /* Targets Support Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | E0D5D3379BC982147C4C5C991B0D1809 /* Pods-MMUploadImage_Example */, 136 | ); 137 | name = "Targets Support Files"; 138 | sourceTree = ""; 139 | }; 140 | A00206AC9C2CDBCF767EF218ABE944BF /* MMUploadImage */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 33F58AAB392A4654BD38A1B5BE6706DF /* Classes */, 144 | ); 145 | path = MMUploadImage; 146 | sourceTree = ""; 147 | }; 148 | BA9400C62483075526EF2D5E4E134E87 /* Development Pods */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | EA3E492A58813B0710850E9FA9F2267A /* MMUploadImage */, 152 | ); 153 | name = "Development Pods"; 154 | sourceTree = ""; 155 | }; 156 | E0D5D3379BC982147C4C5C991B0D1809 /* Pods-MMUploadImage_Example */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 36D490A7386BFB404C9229E2D65AFA55 /* Info.plist */, 160 | FD134F61630CCB68AEBB40F404A82C03 /* Pods-MMUploadImage_Example.modulemap */, 161 | A37E7B75D33D39E23403E669E31E635F /* Pods-MMUploadImage_Example-acknowledgements.markdown */, 162 | B7B4FFFC2573A324606EE5D3E3456EAB /* Pods-MMUploadImage_Example-acknowledgements.plist */, 163 | F5BD20BAA2510222643C237D46A8411C /* Pods-MMUploadImage_Example-dummy.m */, 164 | 3BC50D65ACA0DCB4CABD21496F6C1EFF /* Pods-MMUploadImage_Example-frameworks.sh */, 165 | 7DC4F75CD54915E4B9C005DEB8B534C8 /* Pods-MMUploadImage_Example-resources.sh */, 166 | 849C36E4EE09D4DF014BD1139C8C843B /* Pods-MMUploadImage_Example-umbrella.h */, 167 | 914B7C84064AB60AAE882A21AB067A48 /* Pods-MMUploadImage_Example.debug.xcconfig */, 168 | 237F9C681513A0A580C85B9BBE6DD926 /* Pods-MMUploadImage_Example.release.xcconfig */, 169 | ); 170 | name = "Pods-MMUploadImage_Example"; 171 | path = "Target Support Files/Pods-MMUploadImage_Example"; 172 | sourceTree = ""; 173 | }; 174 | EA3E492A58813B0710850E9FA9F2267A /* MMUploadImage */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | A00206AC9C2CDBCF767EF218ABE944BF /* MMUploadImage */, 178 | 3007ECA9D03ECD63745C252131F3FB3A /* Support Files */, 179 | ); 180 | name = MMUploadImage; 181 | path = ../..; 182 | sourceTree = ""; 183 | }; 184 | F302CD3B306AF1ED96B9AF31FCDBC26C /* iOS */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | A2A6FF208CEC4C2861F1E9D42D651453 /* Foundation.framework */, 188 | E86668F20F252C440D1015B816BE59C5 /* UIKit.framework */, 189 | ); 190 | name = iOS; 191 | sourceTree = ""; 192 | }; 193 | /* End PBXGroup section */ 194 | 195 | /* Begin PBXHeadersBuildPhase section */ 196 | 2BC2F01F592FDECD0C81E0457CD2E730 /* Headers */ = { 197 | isa = PBXHeadersBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 28CE6F23CB03AA6D64A378D85ADCDCFD /* Pods-MMUploadImage_Example-umbrella.h in Headers */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | 871301292ACADB1A21B512EF95FBD9FE /* Headers */ = { 205 | isa = PBXHeadersBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | 0D616069D2E5C166E893B94A1303B784 /* MMUploadImage-umbrella.h in Headers */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXHeadersBuildPhase section */ 213 | 214 | /* Begin PBXNativeTarget section */ 215 | 298A80ADD37290BF472C97F179113DCF /* MMUploadImage */ = { 216 | isa = PBXNativeTarget; 217 | buildConfigurationList = 66B782770AFEA412292E594C91052E2A /* Build configuration list for PBXNativeTarget "MMUploadImage" */; 218 | buildPhases = ( 219 | E6676E072C749E54AA7A642FB9BC3691 /* Sources */, 220 | 06ACB1BDBCFF39A0C8D6031E82A2EB62 /* Frameworks */, 221 | 871301292ACADB1A21B512EF95FBD9FE /* Headers */, 222 | ); 223 | buildRules = ( 224 | ); 225 | dependencies = ( 226 | ); 227 | name = MMUploadImage; 228 | productName = MMUploadImage; 229 | productReference = 3C5C2A3B83AB929961B3D685EAAAFE80 /* MMUploadImage.framework */; 230 | productType = "com.apple.product-type.framework"; 231 | }; 232 | 751AC2E7FA6E42D4805DE807ED0FF05A /* Pods-MMUploadImage_Example */ = { 233 | isa = PBXNativeTarget; 234 | buildConfigurationList = 238CA983781B994BC44BC19B713C8CEF /* Build configuration list for PBXNativeTarget "Pods-MMUploadImage_Example" */; 235 | buildPhases = ( 236 | 61DE76F192563678C4055B06C86ECFAC /* Sources */, 237 | DE2BB65FF8C8D00B489BEEA4A6BB8A21 /* Frameworks */, 238 | 2BC2F01F592FDECD0C81E0457CD2E730 /* Headers */, 239 | ); 240 | buildRules = ( 241 | ); 242 | dependencies = ( 243 | 82A124B79A71A4FA2BD24F14567415DF /* PBXTargetDependency */, 244 | ); 245 | name = "Pods-MMUploadImage_Example"; 246 | productName = "Pods-MMUploadImage_Example"; 247 | productReference = 16FC04523F28A0337DCCBA39EA13BEAA /* Pods_MMUploadImage_Example.framework */; 248 | productType = "com.apple.product-type.framework"; 249 | }; 250 | /* End PBXNativeTarget section */ 251 | 252 | /* Begin PBXProject section */ 253 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 254 | isa = PBXProject; 255 | attributes = { 256 | LastSwiftUpdateCheck = 0730; 257 | LastUpgradeCheck = 0700; 258 | }; 259 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 260 | compatibilityVersion = "Xcode 3.2"; 261 | developmentRegion = English; 262 | hasScannedForEncodings = 0; 263 | knownRegions = ( 264 | en, 265 | ); 266 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 267 | productRefGroup = 5042B64E98817ABDEDFDDAA02901A369 /* Products */; 268 | projectDirPath = ""; 269 | projectRoot = ""; 270 | targets = ( 271 | 298A80ADD37290BF472C97F179113DCF /* MMUploadImage */, 272 | 751AC2E7FA6E42D4805DE807ED0FF05A /* Pods-MMUploadImage_Example */, 273 | ); 274 | }; 275 | /* End PBXProject section */ 276 | 277 | /* Begin PBXSourcesBuildPhase section */ 278 | 61DE76F192563678C4055B06C86ECFAC /* Sources */ = { 279 | isa = PBXSourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 3A5EF4634ED58E93D405B46C05418880 /* Pods-MMUploadImage_Example-dummy.m in Sources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | E6676E072C749E54AA7A642FB9BC3691 /* Sources */ = { 287 | isa = PBXSourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | F80A01767061B2ECE2E5DA9D6608ACFE /* ButtonExtenstion.swift in Sources */, 291 | 3F871929EDE0E92D2EF5494C37064933 /* MMImageUpload.swift in Sources */, 292 | 6577414078C658B8D943678255D9D48C /* MMUploadImage-dummy.m in Sources */, 293 | FA55E3356DDB8781B77915723905DC7F /* WaveObject.swift in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin PBXTargetDependency section */ 300 | 82A124B79A71A4FA2BD24F14567415DF /* PBXTargetDependency */ = { 301 | isa = PBXTargetDependency; 302 | name = MMUploadImage; 303 | target = 298A80ADD37290BF472C97F179113DCF /* MMUploadImage */; 304 | targetProxy = 5A1D1EFF09EA5BAA0D23EDAAEDDF8DDA /* PBXContainerItemProxy */; 305 | }; 306 | /* End PBXTargetDependency section */ 307 | 308 | /* Begin XCBuildConfiguration section */ 309 | 015A368F878AC3E2CEAE21DDE8026304 /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_ANALYZER_NONNULL = YES; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | CODE_SIGNING_REQUIRED = NO; 328 | COPY_PHASE_STRIP = NO; 329 | ENABLE_TESTABILITY = YES; 330 | GCC_C_LANGUAGE_STANDARD = gnu99; 331 | GCC_DYNAMIC_NO_PIC = NO; 332 | GCC_OPTIMIZATION_LEVEL = 0; 333 | GCC_PREPROCESSOR_DEFINITIONS = ( 334 | "POD_CONFIGURATION_DEBUG=1", 335 | "DEBUG=1", 336 | "$(inherited)", 337 | ); 338 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 346 | ONLY_ACTIVE_ARCH = YES; 347 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 348 | STRIP_INSTALLED_PRODUCT = NO; 349 | SYMROOT = "${SRCROOT}/../build"; 350 | }; 351 | name = Debug; 352 | }; 353 | 14405AAB1C1115CC929DDDCA89ADDA0F /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | baseConfigurationReference = 237F9C681513A0A580C85B9BBE6DD926 /* Pods-MMUploadImage_Example.release.xcconfig */; 356 | buildSettings = { 357 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 358 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 359 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 360 | CURRENT_PROJECT_VERSION = 1; 361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 362 | DEFINES_MODULE = YES; 363 | DYLIB_COMPATIBILITY_VERSION = 1; 364 | DYLIB_CURRENT_VERSION = 1; 365 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 366 | ENABLE_STRICT_OBJC_MSGSEND = YES; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | INFOPLIST_FILE = "Target Support Files/Pods-MMUploadImage_Example/Info.plist"; 369 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 370 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 371 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 372 | MACH_O_TYPE = staticlib; 373 | MODULEMAP_FILE = "Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.modulemap"; 374 | MTL_ENABLE_DEBUG_INFO = NO; 375 | OTHER_LDFLAGS = ""; 376 | OTHER_LIBTOOLFLAGS = ""; 377 | PODS_ROOT = "$(SRCROOT)"; 378 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 379 | PRODUCT_NAME = Pods_MMUploadImage_Example; 380 | SDKROOT = iphoneos; 381 | SKIP_INSTALL = YES; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | VERSIONING_SYSTEM = "apple-generic"; 384 | VERSION_INFO_PREFIX = ""; 385 | }; 386 | name = Release; 387 | }; 388 | 44CDBB6D11DE06DB64D6268622BDC47E /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_CONSTANT_CONVERSION = YES; 399 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | CODE_SIGNING_REQUIRED = NO; 407 | COPY_PHASE_STRIP = YES; 408 | ENABLE_NS_ASSERTIONS = NO; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_PREPROCESSOR_DEFINITIONS = ( 411 | "POD_CONFIGURATION_RELEASE=1", 412 | "$(inherited)", 413 | ); 414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 415 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 416 | GCC_WARN_UNDECLARED_SELECTOR = YES; 417 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 418 | GCC_WARN_UNUSED_FUNCTION = YES; 419 | GCC_WARN_UNUSED_VARIABLE = YES; 420 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 421 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 422 | STRIP_INSTALLED_PRODUCT = NO; 423 | SYMROOT = "${SRCROOT}/../build"; 424 | VALIDATE_PRODUCT = YES; 425 | }; 426 | name = Release; 427 | }; 428 | 4C8E437B4F733E5FC7F19536B879086F /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | baseConfigurationReference = 914B7C84064AB60AAE882A21AB067A48 /* Pods-MMUploadImage_Example.debug.xcconfig */; 431 | buildSettings = { 432 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 433 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 434 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 435 | CURRENT_PROJECT_VERSION = 1; 436 | DEBUG_INFORMATION_FORMAT = dwarf; 437 | DEFINES_MODULE = YES; 438 | DYLIB_COMPATIBILITY_VERSION = 1; 439 | DYLIB_CURRENT_VERSION = 1; 440 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 441 | ENABLE_STRICT_OBJC_MSGSEND = YES; 442 | GCC_NO_COMMON_BLOCKS = YES; 443 | INFOPLIST_FILE = "Target Support Files/Pods-MMUploadImage_Example/Info.plist"; 444 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 447 | MACH_O_TYPE = staticlib; 448 | MODULEMAP_FILE = "Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.modulemap"; 449 | MTL_ENABLE_DEBUG_INFO = YES; 450 | OTHER_LDFLAGS = ""; 451 | OTHER_LIBTOOLFLAGS = ""; 452 | PODS_ROOT = "$(SRCROOT)"; 453 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 454 | PRODUCT_NAME = Pods_MMUploadImage_Example; 455 | SDKROOT = iphoneos; 456 | SKIP_INSTALL = YES; 457 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 458 | TARGETED_DEVICE_FAMILY = "1,2"; 459 | VERSIONING_SYSTEM = "apple-generic"; 460 | VERSION_INFO_PREFIX = ""; 461 | }; 462 | name = Debug; 463 | }; 464 | C539020F44EBD59AFD4BBD34E84EFA24 /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | baseConfigurationReference = BD7D3F974C9485348A56176F0F467B76 /* MMUploadImage.xcconfig */; 467 | buildSettings = { 468 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 469 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 470 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 471 | CURRENT_PROJECT_VERSION = 1; 472 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 473 | DEFINES_MODULE = YES; 474 | DYLIB_COMPATIBILITY_VERSION = 1; 475 | DYLIB_CURRENT_VERSION = 1; 476 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 477 | ENABLE_STRICT_OBJC_MSGSEND = YES; 478 | GCC_NO_COMMON_BLOCKS = YES; 479 | GCC_PREFIX_HEADER = "Target Support Files/MMUploadImage/MMUploadImage-prefix.pch"; 480 | INFOPLIST_FILE = "Target Support Files/MMUploadImage/Info.plist"; 481 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 482 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 484 | MODULEMAP_FILE = "Target Support Files/MMUploadImage/MMUploadImage.modulemap"; 485 | MTL_ENABLE_DEBUG_INFO = NO; 486 | PRODUCT_NAME = MMUploadImage; 487 | SDKROOT = iphoneos; 488 | SKIP_INSTALL = YES; 489 | SWIFT_VERSION = 3.0; 490 | TARGETED_DEVICE_FAMILY = "1,2"; 491 | VERSIONING_SYSTEM = "apple-generic"; 492 | VERSION_INFO_PREFIX = ""; 493 | }; 494 | name = Release; 495 | }; 496 | F5704E83B27171932EA859C691C20232 /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | baseConfigurationReference = BD7D3F974C9485348A56176F0F467B76 /* MMUploadImage.xcconfig */; 499 | buildSettings = { 500 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 501 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 502 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 503 | CURRENT_PROJECT_VERSION = 1; 504 | DEBUG_INFORMATION_FORMAT = dwarf; 505 | DEFINES_MODULE = YES; 506 | DYLIB_COMPATIBILITY_VERSION = 1; 507 | DYLIB_CURRENT_VERSION = 1; 508 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 509 | ENABLE_STRICT_OBJC_MSGSEND = YES; 510 | GCC_NO_COMMON_BLOCKS = YES; 511 | GCC_PREFIX_HEADER = "Target Support Files/MMUploadImage/MMUploadImage-prefix.pch"; 512 | INFOPLIST_FILE = "Target Support Files/MMUploadImage/Info.plist"; 513 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 514 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 515 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 516 | MODULEMAP_FILE = "Target Support Files/MMUploadImage/MMUploadImage.modulemap"; 517 | MTL_ENABLE_DEBUG_INFO = YES; 518 | PRODUCT_NAME = MMUploadImage; 519 | SDKROOT = iphoneos; 520 | SKIP_INSTALL = YES; 521 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 522 | SWIFT_VERSION = 3.0; 523 | TARGETED_DEVICE_FAMILY = "1,2"; 524 | VERSIONING_SYSTEM = "apple-generic"; 525 | VERSION_INFO_PREFIX = ""; 526 | }; 527 | name = Debug; 528 | }; 529 | /* End XCBuildConfiguration section */ 530 | 531 | /* Begin XCConfigurationList section */ 532 | 238CA983781B994BC44BC19B713C8CEF /* Build configuration list for PBXNativeTarget "Pods-MMUploadImage_Example" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 4C8E437B4F733E5FC7F19536B879086F /* Debug */, 536 | 14405AAB1C1115CC929DDDCA89ADDA0F /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 015A368F878AC3E2CEAE21DDE8026304 /* Debug */, 545 | 44CDBB6D11DE06DB64D6268622BDC47E /* Release */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | defaultConfigurationName = Release; 549 | }; 550 | 66B782770AFEA412292E594C91052E2A /* Build configuration list for PBXNativeTarget "MMUploadImage" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | F5704E83B27171932EA859C691C20232 /* Debug */, 554 | C539020F44EBD59AFD4BBD34E84EFA24 /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | /* End XCConfigurationList section */ 560 | }; 561 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 562 | } 563 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/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 | 2.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/MMUploadImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MMUploadImage : NSObject 3 | @end 4 | @implementation PodsDummy_MMUploadImage 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/MMUploadImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/MMUploadImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double MMUploadImageVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char MMUploadImageVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/MMUploadImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module MMUploadImage { 2 | umbrella header "MMUploadImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MMUploadImage/MMUploadImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MMUploadImage 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 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_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-MMUploadImage_Example/Pods-MMUploadImage_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MMUploadImage 5 | 6 | Copyright (c) 2016 Millman 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-MMUploadImage_Example/Pods-MMUploadImage_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) 2016 Millman <millmanyang@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 | MMUploadImage 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-MMUploadImage_Example/Pods-MMUploadImage_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MMUploadImage_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MMUploadImage_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_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 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/MMUploadImage/MMUploadImage.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "$BUILT_PRODUCTS_DIR/MMUploadImage/MMUploadImage.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_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 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | 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}" 48 | 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} 49 | ;; 50 | *.xib) 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\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 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\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | 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}" 102 | fi 103 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_MMUploadImage_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_MMUploadImage_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MMUploadImage" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MMUploadImage/MMUploadImage.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "MMUploadImage" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MMUploadImage_Example { 2 | umbrella header "Pods-MMUploadImage_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MMUploadImage_Example/Pods-MMUploadImage_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MMUploadImage" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MMUploadImage/MMUploadImage.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "MMUploadImage" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /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/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | //import MMUploadImage 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Millman 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 | -------------------------------------------------------------------------------- /MMUploadImage.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint MMUploadImage.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'MMUploadImage' 11 | s.version = '2.0.8' 12 | s.summary = 'MMUploadImage' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = 'Its a Extension helper for UIImageView to Upload a image when post to server' 21 | 22 | s.homepage = 'https://github.com/MillmanY/UploadImage' 23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 24 | s.license = { :type => 'MIT', :file => 'LICENSE' } 25 | s.author = { 'Millman' => 'millmanyang@gmail.com' } 26 | s.source = { :git => 'https://github.com/MillmanY/UploadImage.git', :tag => s.version.to_s } 27 | # s.social_media_url = 'https://twitter.com/' 28 | 29 | s.ios.deployment_target = '8.0' 30 | 31 | s.source_files = 'MMUploadImage/Classes/**/*' 32 | 33 | # s.resource_bundles = { 34 | # 'MMUploadImage' => ['MMUploadImage/Assets/*.png'] 35 | # } 36 | 37 | # s.public_header_files = 'Pod/Classes/**/*.h' 38 | s.frameworks = 'UIKit' 39 | s.requires_arc = true 40 | 41 | # s.dependency 'AFNetworking', '~> 2.3' 42 | end 43 | -------------------------------------------------------------------------------- /MMUploadImage/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/MMUploadImage/Assets/.gitkeep -------------------------------------------------------------------------------- /MMUploadImage/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/MMUploadImage/Classes/.gitkeep -------------------------------------------------------------------------------- /MMUploadImage/Classes/ButtonExtenstion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonExtenstion.swift 3 | // Pods 4 | // 5 | // Created by MILLMAN on 2016/9/12. 6 | // 7 | // 8 | import UIKit 9 | private var OriginalSize = "OriginalSizeKey" 10 | public extension UIButton { 11 | 12 | fileprivate var originalSize:CGSize { 13 | get { 14 | if let size = objc_getAssociatedObject(self,&OriginalSize) as? CGSize { 15 | return size 16 | } else { 17 | let size = CGSize.zero 18 | self.originalSize = size 19 | return size 20 | } 21 | } 22 | set { 23 | objc_setAssociatedObject(self,&OriginalSize,newValue,.OBJC_ASSOCIATION_RETAIN) 24 | } 25 | } 26 | 27 | public func uploadImage(image: UIImage, progress: Float) { 28 | self.setImageSize() 29 | self.imageView?.uploadImage(image:image, progress: progress) 30 | } 31 | 32 | public func uploadImageFail() { 33 | self.imageView?.uploadImageFail() 34 | } 35 | 36 | public func uploadImageFail(duration: CFTimeInterval) { 37 | self.imageView?.uploadImageFail(duration: duration) 38 | } 39 | 40 | public func uploadCompleted() { 41 | self.imageView?.uploadCompleted() 42 | } 43 | 44 | public func uploadCompleted(duration: CFTimeInterval) { 45 | self.imageView?.uploadCompleted(duration: duration) 46 | } 47 | 48 | public func completedBlock(completed:(()-> Void)?) { 49 | 50 | self.imageView?.completedBlock = { 51 | if let c = completed { 52 | self.setImage(self.reDrawImage(), for: .normal) 53 | c() 54 | } 55 | } 56 | } 57 | 58 | public func failedBlock(completed:(()-> Void)?) { 59 | self.imageView?.failBlock = completed 60 | } 61 | 62 | public func setStyle(style:LoadingStyle) { 63 | self.imageView?.style = style 64 | } 65 | 66 | public func setAutoCompleted(isAuto:Bool) { 67 | self.imageView?.autoCompleted = isAuto 68 | } 69 | 70 | fileprivate func reDrawImage() -> UIImage { 71 | var frame = CGRect.zero 72 | frame.size = self.originalSize 73 | UIGraphicsBeginImageContext(self.originalSize) 74 | self.imageView?.uploadImage!.draw(in: frame) 75 | let resize = UIGraphicsGetImageFromCurrentImageContext() 76 | UIGraphicsEndImageContext() 77 | return resize! 78 | } 79 | 80 | fileprivate func setImageSize() { 81 | if let size = self.imageView?.frame.size 82 | , self.originalSize == CGSize.zero { 83 | self.originalSize = size 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /MMUploadImage/Classes/MMImageUpload.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageUpload.swift 3 | // ImageExtensionTest 4 | // 5 | // Created by MILLMAN on 2016/7/14. 6 | // Copyright © 2016年 MILLMAN. All rights reserved. 7 | // 8 | import UIKit 9 | 10 | public enum UploadStatus { 11 | case none 12 | case uploading 13 | case willFailed 14 | case failed 15 | case willCompleted 16 | case completed 17 | } 18 | 19 | public enum LoadingStyle { 20 | case sector 21 | case centerExpand 22 | case centerShrink 23 | case roundWith(lineWdith:CGFloat,lineColor:UIColor) 24 | case wave 25 | } 26 | 27 | private var WaveObjectKey = "WaveObjectKey" 28 | private var WaveTimer = "WaveKey" 29 | private var ProgressTimer = "TimerKey" 30 | private var SECTORLAYER = "SectorKey" 31 | private var LastProgress = "ProgressKey" 32 | private var BackgroundLayer = "BackgroundLayer" 33 | private var UploadImage = "ImageKey" 34 | private var AutoCompleted = "AutoCompletedKey" 35 | private var CompletedBlock = "CompletedKey" 36 | private var FailBlock = "FailKey" 37 | private var UploadKey = "UploadKey" 38 | private var StyleKey = "StyleKey" 39 | private var CurrentProgress = "CurrentProgressKey" 40 | private let DefaultDuration = 0.3 41 | 42 | public extension UIImageView { 43 | 44 | fileprivate var waveObject:WaveObject { 45 | set { 46 | objc_setAssociatedObject(self, &WaveObjectKey, newValue, .OBJC_ASSOCIATION_RETAIN) 47 | } get { 48 | if let wave = objc_getAssociatedObject(self, &WaveObjectKey) as? WaveObject { 49 | return wave 50 | } else { 51 | let wave = WaveObject.init(layerSize: self.sectorLayer.frame.size,speed: 3.0) 52 | self.waveObject = wave 53 | return wave 54 | } 55 | } 56 | } 57 | 58 | fileprivate var currentProgress:Float { 59 | set { 60 | // Prevent Reset Value When Fail or Completed 61 | if self.status != .completed && 62 | self.status != .failed && 63 | newValue != currentProgress && 64 | !(currentProgress == 1.0 || currentProgress == 0.0){ 65 | } 66 | objc_setAssociatedObject(self, &CurrentProgress, newValue, .OBJC_ASSOCIATION_RETAIN) 67 | 68 | } get { 69 | if let progress = objc_getAssociatedObject(self, &CurrentProgress) as? Float { 70 | return progress 71 | } else { 72 | return 0.0 73 | } 74 | } 75 | } 76 | 77 | public var style:LoadingStyle { 78 | get { 79 | if let current = objc_getAssociatedObject(self,&StyleKey) as? LoadingStyle { 80 | return current 81 | } else { 82 | self.style = .sector 83 | return .sector 84 | } 85 | } 86 | set { 87 | objc_setAssociatedObject(self, &StyleKey, newValue, .OBJC_ASSOCIATION_RETAIN) 88 | } 89 | } 90 | 91 | public var status:UploadStatus { 92 | get { 93 | if let current = objc_getAssociatedObject(self,&UploadKey) as? UploadStatus { 94 | return current 95 | } else { 96 | return .none 97 | } 98 | } 99 | set { 100 | objc_setAssociatedObject(self,&UploadKey,newValue,.OBJC_ASSOCIATION_RETAIN) 101 | } 102 | } 103 | 104 | public var completedBlock:(() -> Void)? { 105 | get { 106 | if let c = objc_getAssociatedObject(self, &CompletedBlock) as? (() -> Void) { 107 | return c 108 | } 109 | return nil 110 | } 111 | set { 112 | let new:Any = newValue 113 | 114 | objc_setAssociatedObject(self,&CompletedBlock,new,.OBJC_ASSOCIATION_RETAIN) 115 | } 116 | } 117 | 118 | public var failBlock:(()-> Void)? { 119 | get { 120 | if let c = objc_getAssociatedObject(self, &FailBlock) as? (() -> Void) { 121 | return c 122 | } 123 | return nil 124 | } 125 | set { 126 | 127 | let new:Any = newValue 128 | objc_setAssociatedObject(self,&FailBlock,new as Any,.OBJC_ASSOCIATION_RETAIN) 129 | } 130 | } 131 | 132 | fileprivate var backgroundLayer:CAShapeLayer { 133 | set { 134 | objc_setAssociatedObject(self, &BackgroundLayer, newValue, .OBJC_ASSOCIATION_RETAIN) 135 | 136 | } get { 137 | if let layer = objc_getAssociatedObject(self, &BackgroundLayer) as? CAShapeLayer { 138 | return layer 139 | } else { 140 | let layer = CAShapeLayer() 141 | self.layer.insertSublayer(layer, below: sectorLayer) 142 | layer.frame = self.bounds 143 | layer.cornerRadius = self.bounds.width/2 144 | layer.masksToBounds = true 145 | layer.backgroundColor = UIColor.black.withAlphaComponent(0.5).cgColor 146 | layer.isHidden = true 147 | self.backgroundLayer = layer 148 | return layer 149 | } 150 | } 151 | } 152 | 153 | fileprivate var waveTimer:Timer? { 154 | set { 155 | objc_setAssociatedObject(self, &WaveTimer, newValue, .OBJC_ASSOCIATION_RETAIN) 156 | 157 | } get { 158 | if let timer = objc_getAssociatedObject(self, &WaveTimer) as? Timer { 159 | return timer 160 | } else { 161 | return nil 162 | } 163 | } 164 | } 165 | 166 | fileprivate var progressTimer:Timer? { 167 | set { 168 | objc_setAssociatedObject(self, &ProgressTimer, newValue, .OBJC_ASSOCIATION_RETAIN) 169 | 170 | } get { 171 | if let timer = objc_getAssociatedObject(self, &ProgressTimer) as? Timer { 172 | return timer 173 | } else { 174 | return nil 175 | } 176 | } 177 | } 178 | 179 | fileprivate var sectorLayer:CAShapeLayer { 180 | set { 181 | objc_setAssociatedObject(self, &SECTORLAYER, newValue, .OBJC_ASSOCIATION_RETAIN) 182 | } get { 183 | if let layer = objc_getAssociatedObject(self, &SECTORLAYER) as? CAShapeLayer { 184 | return layer 185 | } else { 186 | self.layer.cornerRadius = self.frame.size.width/2 187 | self.clipsToBounds = true 188 | self.sectorLayer = CAShapeLayer() 189 | self.sectorLayer.masksToBounds = true 190 | self.layer.addSublayer(self.sectorLayer) 191 | return self.sectorLayer 192 | } 193 | } 194 | } 195 | 196 | fileprivate var lastProgress:Float { 197 | set { 198 | objc_setAssociatedObject(self, &LastProgress, newValue, .OBJC_ASSOCIATION_RETAIN) 199 | } get { 200 | if let progress = objc_getAssociatedObject(self, &LastProgress) as? Float { 201 | return progress 202 | } 203 | return Float(0.0) 204 | } 205 | } 206 | 207 | var uploadImage:UIImage? { 208 | set { 209 | objc_setAssociatedObject(self, &UploadImage, newValue, .OBJC_ASSOCIATION_RETAIN) 210 | 211 | } get { 212 | if let image = objc_getAssociatedObject(self, &UploadImage) as? UIImage { 213 | return image 214 | } 215 | return nil 216 | } 217 | } 218 | 219 | var autoCompleted:Bool { 220 | set { 221 | objc_setAssociatedObject(self, &AutoCompleted, newValue, .OBJC_ASSOCIATION_RETAIN) 222 | 223 | } get { 224 | if let auto = objc_getAssociatedObject(self, &AutoCompleted) as? Bool { 225 | return auto 226 | } 227 | return false 228 | } 229 | } 230 | } 231 | 232 | public extension UIImageView { 233 | 234 | func animationDoing(timer:Timer) { 235 | self.currentProgress = animationProgress() 236 | } 237 | 238 | public func uploadImage(image:UIImage,progress:Float) { 239 | self.uploadImage(image:image, progress: progress, duration: DefaultDuration) 240 | } 241 | 242 | fileprivate func uploadImage(image:UIImage,progress:Float,duration:CFTimeInterval) { 243 | let fixProgress = (progress > 1.0) ? 1.0 : progress 244 | 245 | self.uploadImage = image 246 | if self.status == .uploading && fixProgress < 1.0 || self.status == .completed && fixProgress == 1.0{ 247 | return 248 | } 249 | 250 | DispatchQueue.main.async { 251 | if self.status != .willFailed { 252 | self.backgroundLayer.isHidden = (progress > 0.0) ? false : true 253 | } 254 | self.backgroundLayer.frame = self.bounds 255 | self.sectorLayer.contents = image.cgImage 256 | self.sectorLayer.frame = self.layerFrame() 257 | let radius = self.sectorLayer.frame.width/2 258 | self.sectorLayer.cornerRadius = radius 259 | self.addAnimationWith(fixProgress,duration: duration) 260 | } 261 | } 262 | 263 | public func uploadImageFail() { 264 | self.uploadImageFail(duration:DefaultDuration) 265 | } 266 | 267 | public func uploadImageFail(duration:CFTimeInterval) { 268 | 269 | if self.status == .completed || self.status == .failed { 270 | return 271 | } 272 | 273 | self.status = .willFailed 274 | CATransaction.begin() 275 | CATransaction.setCompletionBlock { 276 | self.lastProgress = (self.lastProgress <= 1.0) ? self.lastProgress : 1.0 277 | 278 | if let i = self.uploadImage { 279 | self.uploadImage(image: i, progress: 0.0, duration: duration) 280 | } else { 281 | self.status = .none 282 | print("Not set Upload Image") 283 | } 284 | } 285 | self.sectorLayer.frame = self.layerFrame() 286 | let radius = sectorLayer.frame.width/2 287 | 288 | self.sectorLayer.cornerRadius = radius 289 | self.sectorLayer.mask?.cornerRadius = radius 290 | CATransaction.commit() 291 | } 292 | 293 | public func uploadCompleted() { 294 | self.uploadCompleted(duration:DefaultDuration) 295 | } 296 | 297 | public func uploadCompleted(duration:CFTimeInterval) { 298 | if self.status == .completed { 299 | return 300 | } 301 | 302 | if let i = self.uploadImage { 303 | self.status = .willCompleted 304 | self.uploadImage(image:i, progress:1.0,duration: duration) 305 | } else { 306 | self.status = .none 307 | print("not set Upload Image") 308 | } 309 | } 310 | 311 | fileprivate func layerFrame() -> CGRect { 312 | switch self.style { 313 | case .sector: 314 | return self.bounds.insetBy(dx: 10, dy: 10) 315 | case .roundWith(let lineWdith, _): 316 | return self.bounds.insetBy(dx: lineWdith/2, dy: lineWdith/2) 317 | default: 318 | return self.bounds 319 | } 320 | } 321 | } 322 | 323 | extension UIImageView:CAAnimationDelegate { 324 | public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 325 | 326 | if flag == true { 327 | progressTimer?.invalidate() 328 | progressTimer = nil 329 | } 330 | 331 | if lastProgress >= 1.0 && autoCompleted || self.status == .willCompleted{ 332 | 333 | if !flag { 334 | return 335 | } 336 | 337 | waveTimer?.invalidate() 338 | waveTimer = nil 339 | self.status = .completed 340 | self.image = self.uploadImage 341 | let radius = self.bounds.width/2 342 | self.sectorLayer.frame = self.bounds 343 | self.sectorLayer.cornerRadius = radius 344 | self.sectorLayer.mask?.frame = self.bounds 345 | self.sectorLayer.mask?.cornerRadius = radius 346 | self.backgroundLayer.isHidden = true 347 | self.backgroundLayer.path = nil 348 | if let c = completedBlock { 349 | c() 350 | } 351 | } else if (lastProgress <= 0.0) { 352 | if !flag { 353 | return 354 | } 355 | waveTimer?.invalidate() 356 | waveTimer = nil 357 | self.status = .none 358 | if let f = failBlock{ 359 | f() 360 | } 361 | self.backgroundLayer.isHidden = true 362 | self.backgroundLayer.path = nil 363 | 364 | } else { 365 | self.status = .none 366 | } 367 | } 368 | 369 | public func animationDidStart(_ anim: CAAnimation) { 370 | if progressTimer == nil { 371 | progressTimer = Timer.init(timeInterval: 0.01, target: self, selector: #selector(UIImageView.animationDoing(timer:)), userInfo: nil, repeats: true) 372 | if let pTimer = progressTimer { 373 | RunLoop.main.add(pTimer, forMode: RunLoopMode.commonModes) 374 | } 375 | } 376 | 377 | if (self.status != .willFailed && self.status != .willCompleted) { 378 | self.status = .uploading 379 | } 380 | } 381 | } 382 | 383 | // Animation 384 | extension UIImageView { 385 | 386 | fileprivate func addAnimationWith(_ progress:Float,duration:CFTimeInterval) { 387 | let animation = CABasicAnimation() 388 | animation.delegate = self 389 | animation.duration = duration 390 | animation.isRemovedOnCompletion = false 391 | animation.setValue("StrokeProgress", forKey: "animationID") 392 | animation.fromValue = self.animationFromValue() 393 | animation.toValue = self.animationToValue(progress: progress) 394 | animation.fillMode = kCAFillModeBoth 395 | 396 | switch self.style { 397 | case .sector: 398 | animation.keyPath = "strokeEnd" 399 | self.sectorLayer.mask = self.generateMask(progress:nil) 400 | self.sectorLayer.mask!.add(animation, forKey: "Sector") 401 | case .centerExpand: 402 | animation.keyPath = "transform.scale" 403 | self.sectorLayer.mask = self.generateMask(progress:nil) 404 | self.sectorLayer.mask!.add(animation, forKey: "CenterExpand") 405 | case .centerShrink: 406 | animation.keyPath = "lineWidth" 407 | self.sectorLayer.mask = self.generateMask(progress:nil) 408 | self.sectorLayer.mask!.add(animation, forKey: "CenterShrink") 409 | case .roundWith(let lineWidth, _): 410 | animation.keyPath = "strokeEnd" 411 | let resetPro:Float = (self.status == .willFailed) ? 0.0 : 1.0 412 | self.sectorLayer.mask = self.generateMask(progress:resetPro) 413 | let radius = backgroundLayer.frame.width/2 414 | let bezier = UIBezierPath(roundedRect: backgroundLayer.bounds, cornerRadius:radius) 415 | self.backgroundLayer.lineWidth = lineWidth 416 | self.backgroundLayer.path = bezier.cgPath 417 | self.backgroundLayer.strokeColor = self.maskStrokeColor() 418 | self.backgroundLayer.fillColor = self.maskFillColor() 419 | self.backgroundLayer.add(animation, forKey: "Round") 420 | case .wave: 421 | animation.keyPath = "transform.translation.y" 422 | if waveTimer == nil { 423 | self.sectorLayer.mask = self.generateMask(progress: nil) 424 | waveTimer = Timer.init(timeInterval: 0.05, target: self, selector: #selector(UIImageView.reDrawWave(timer:)), userInfo: nil, repeats: true) 425 | if let wTimer = waveTimer { 426 | RunLoop.main.add(wTimer, forMode: RunLoopMode.commonModes) 427 | } 428 | } 429 | 430 | self.sectorLayer.mask!.add(animation, forKey: "Wave") 431 | } 432 | self.lastProgress = progress 433 | } 434 | 435 | func reDrawWave(timer:Timer) { 436 | if let m = self.sectorLayer.mask as? CAShapeLayer{ 437 | m.path = waveObject.generateWavePath(CGFloat(10)) 438 | } 439 | } 440 | 441 | fileprivate func animationFromValue() -> AnyObject? { 442 | switch self.style { 443 | case .sector,.centerExpand: 444 | return self.lastProgress as AnyObject? 445 | case .centerShrink: 446 | let radius = sectorLayer.frame.width/2 447 | return (self.lastProgress * Float(radius*2)) as AnyObject? 448 | case .roundWith(_, _): 449 | return self.lastProgress as AnyObject? 450 | case .wave: 451 | let height = Float(self.sectorLayer.frame.height) 452 | return NSNumber(value: (1-self.lastProgress) * height as Float) 453 | } 454 | } 455 | 456 | fileprivate func animationToValue(progress:Float) -> AnyObject? { 457 | let progressValue = (self.status == .willFailed) ? 0 : (progress <= 1.0) ? progress : 1.0 458 | switch self.style { 459 | case .sector,.centerExpand: 460 | return progressValue as AnyObject? 461 | case .centerShrink: 462 | let radius = sectorLayer.frame.width/2 463 | return (progressValue*Float(radius*2)) as AnyObject? 464 | case .roundWith(_, _): 465 | return progressValue as AnyObject? 466 | case .wave: 467 | let height = Float(self.sectorLayer.frame.height) 468 | return NSNumber(value: (1-progress) * height as Float) 469 | } 470 | } 471 | 472 | fileprivate func generateMask(progress:Float?) -> CAShapeLayer { 473 | let radius:CGFloat = sectorLayer.frame.width/2 474 | let bezier = UIBezierPath(roundedRect: sectorLayer.bounds, cornerRadius:radius) 475 | let maskLayer = CAShapeLayer() 476 | if let p = progress { 477 | maskLayer.strokeEnd = CGFloat(p) 478 | } 479 | maskLayer.frame = sectorLayer.bounds 480 | maskLayer.cornerRadius = radius 481 | maskLayer.path = bezier.cgPath 482 | maskLayer.strokeColor = self.maskStrokeColor() 483 | maskLayer.lineWidth = radius*2 484 | maskLayer.fillColor = self.maskFillColor() 485 | maskLayer.masksToBounds = true 486 | return maskLayer 487 | } 488 | 489 | fileprivate func maskStrokeColor () -> CGColor { 490 | switch self.style { 491 | case .sector,.centerShrink: 492 | return UIColor.blue.cgColor 493 | case .centerExpand,.wave: 494 | return UIColor.clear.cgColor 495 | case .roundWith(_, let color): 496 | return color.cgColor 497 | } 498 | } 499 | 500 | fileprivate func maskFillColor () -> CGColor { 501 | switch self.style { 502 | case .centerExpand,.wave: 503 | return UIColor.blue.cgColor 504 | default: 505 | return UIColor.clear.cgColor 506 | } 507 | } 508 | 509 | fileprivate func animationProgress () -> Float { 510 | var value:CGFloat = 0.0 511 | 512 | if let layer = self.sectorLayer.mask?.presentation() as? CAShapeLayer , 513 | let background = self.backgroundLayer.presentation(){ 514 | switch self.style { 515 | case .sector: 516 | value = layer.strokeEnd 517 | case .centerExpand: 518 | value = layer.transform.m22 519 | case .centerShrink: 520 | value = layer.lineWidth/self.bounds.width 521 | case .roundWith(_, _): 522 | value = background.strokeEnd 523 | case .wave: 524 | value = (layer.frame.height - layer.frame.origin.y)/layer.frame.height 525 | } 526 | let floatStr = NSString.init(format: "%0.3f", value) 527 | return floatStr.floatValue 528 | } else { 529 | return 0.0 530 | } 531 | } 532 | } 533 | -------------------------------------------------------------------------------- /MMUploadImage/Classes/WaveObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WaveObject.swift 3 | // Pods 4 | // 5 | // Created by MILLMAN on 2016/9/1. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class WaveObject: NSObject { 12 | fileprivate var speed:Float = 0.0 13 | fileprivate var a = 0.0 14 | fileprivate var offset:Float = 0.0 15 | fileprivate var waveWidth = 0.0 16 | fileprivate var toAdd = true 17 | fileprivate var layerSize:CGSize = CGSize.zero 18 | 19 | init (layerSize:CGSize,speed:Float) { 20 | self.layerSize = layerSize 21 | self.speed = speed 22 | } 23 | 24 | func generateWavePath(_ yPos:CGFloat) -> CGPath { 25 | a = (toAdd) ? a + 0.01 : a - 0.01 26 | toAdd = (a <= 1 ) ? true : (a >= 2.5) ? false : toAdd 27 | offset = (offset < MAXFLOAT) ? offset + speed : offset - speed 28 | let bezier = UIBezierPath() 29 | 30 | bezier.lineWidth = 1 31 | bezier.move(to: CGPoint(x: 0, y: yPos)) 32 | 33 | let width = Double(layerSize.width) 34 | for x in 0.. Void)?) 71 | public func failedBlock(completed: (() -> Void)?) 72 | public func setStyle(style: MMUploadImage.LoadingStyle) 73 | public func setAutoCompleted(isAuto: Bool) 74 | 75 | ## Installation 76 | 77 | MMUploadImage is available through [CocoaPods](http://cocoapods.org). To install 78 | it, simply add the following line to your Podfile: 79 | 80 | ```ruby 81 | Swift 3 82 | pod 'MMUploadImage' 83 | Swift 2.3 84 | pod 'MMUploadImage', '~> 1.0' 85 | ``` 86 | 87 | ## Author 88 | 89 | Millman, millmanyang@gmail.com 90 | 91 | ## License 92 | 93 | MMUploadImage is available under the MIT license. See the LICENSE file for more info. 94 | -------------------------------------------------------------------------------- /RoundMid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/RoundMid.gif -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /midscreen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/midscreen.gif -------------------------------------------------------------------------------- /wave.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MillmanY/UploadImage/3648ce000d714ac77580708adff2304d7feb01fa/wave.gif --------------------------------------------------------------------------------