├── Carthage └── Build │ ├── .Alamofire.version │ ├── .SDWebImage.version │ └── Mac │ ├── Alamofire.framework │ ├── Alamofire │ ├── Headers │ ├── Modules │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── Alamofire │ │ ├── Headers │ │ │ ├── Alamofire-Swift.h │ │ │ └── Alamofire.h │ │ ├── Modules │ │ │ ├── Alamofire.swiftmodule │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ └── x86_64.swiftmodule │ │ │ └── module.modulemap │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current │ └── SDWebImage.framework │ ├── Headers │ ├── Modules │ ├── Resources │ ├── SDWebImage │ └── Versions │ ├── A │ ├── Headers │ │ ├── MKAnnotationView+WebCache.h │ │ ├── NSButton+WebCache.h │ │ ├── NSData+ImageContentType.h │ │ ├── NSImage+WebCache.h │ │ ├── SDAnimatedImageRep.h │ │ ├── SDImageCache.h │ │ ├── SDImageCacheConfig.h │ │ ├── SDWebImage.h │ │ ├── SDWebImageCoder.h │ │ ├── SDWebImageCoderHelper.h │ │ ├── SDWebImageCodersManager.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageFrame.h │ │ ├── SDWebImageGIFCoder.h │ │ ├── SDWebImageImageIOCoder.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImageTransition.h │ │ ├── SDWebImageWebPCoder.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+WebP.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ ├── UIView+WebCache.h │ │ └── UIView+WebCacheOperation.h │ ├── Modules │ │ └── module.modulemap │ ├── Resources │ │ └── Info.plist │ └── SDWebImage │ └── Current ├── uploadIPA.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── jason.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── mac.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── jason.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ └── mac.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist └── uploadIPA ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ ├── Contents.json │ ├── icon-128.png │ ├── icon-128@2x.png │ ├── icon-16.png │ ├── icon-16@2x.png │ ├── icon-256.png │ ├── icon-256@2x.png │ ├── icon-32.png │ ├── icon-32@2x.png │ ├── icon-512.png │ └── icon-512@2x.png ├── Contents.json ├── Icon-Arrow-down.imageset │ ├── Contents.json │ ├── Icon-Arrow-down.png │ └── Icon-Arrow-down@2x.png ├── Icon-Arrow-hover.imageset │ ├── Contents.json │ ├── Icon-Arrow-hover.png │ └── Icon-Arrow-hover@2x.png ├── Icon-Arrow-normal.imageset │ ├── Contents.json │ ├── Icon-Arrow-normal.png │ └── Icon-Arrow-normal@2x.png ├── Icon-choose-hover.imageset │ ├── Contents.json │ ├── Icon-choose-hover.png │ └── Icon-choose-hover@2x.png ├── airplane.imageset │ ├── Contents.json │ └── airplane.png ├── error.imageset │ ├── Contents.json │ └── error.png ├── icon-choose-down.imageset │ ├── Contents.json │ ├── icon-choose-down.png │ └── icon-choose-down@2x.png ├── icon-choose-normal.imageset │ ├── Contents.json │ ├── icon-choose-normal.png │ └── icon-choose-normal@2x.png ├── icon-close-down.imageset │ ├── Contents.json │ ├── icon-close-down.png │ └── icon-close-down@2x.png ├── icon-close-normal.imageset │ ├── Contents.json │ ├── icon-close-normal.png │ └── icon-close-normal@2x.png ├── icon-enter-down.imageset │ ├── Contents.json │ ├── icon-enter-down.png │ └── icon-enter-down@2x.png ├── icon-enter-hover.imageset │ ├── Contents.json │ ├── icon-enter-hover.png │ └── icon-enter-hover@2x.png ├── icon-enter-normal.imageset │ ├── Contents.json │ ├── icon-enter-normal.png │ └── icon-enter-normal@2x.png ├── icon-enter-undo.imageset │ ├── Contents.json │ ├── icon-enter-undo.png │ └── icon-enter-undo@2x.png ├── pgy.imageset │ ├── Contents.json │ └── pyg.png └── success.imageset │ ├── Contents.json │ └── success.png ├── Common └── Common.swift ├── Extension ├── HoverButton.swift └── NSImage+QRCode.swift ├── Info.plist ├── Login ├── Base.lproj │ └── Main.storyboard ├── Controller │ ├── LoginSettingVC.swift │ ├── LoginVC.swift │ └── LoginWindow.swift ├── Model │ ├── FirApp.swift │ └── PgyApp.swift └── ViewModel │ ├── FirAppVM.swift │ ├── FirAppVM.temp_caseinsensitive_rename.swift │ └── PgyAppVM.swift ├── Main ├── Controller │ ├── LeftVC.swift │ ├── RightVC.swift │ └── UploadVC.swift ├── MainUI.storyboard ├── Model │ └── ParsedAppModel.swift └── View │ ├── AppTableCellView.swift │ └── CustomTableRowView.swift └── Tools ├── HttpTool.swift └── Shell.swift /Carthage/Build/.Alamofire.version: -------------------------------------------------------------------------------- 1 | { 2 | "commitish" : "4.7.3", 3 | "Mac" : [ 4 | { 5 | "name" : "Alamofire", 6 | "hash" : "8cde59447cc05b5404c8d59ad20efc8b7b60d077cd9f3cb17b4ab70d761349e3" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /Carthage/Build/.SDWebImage.version: -------------------------------------------------------------------------------- 1 | { 2 | "commitish" : "4.4.2", 3 | "Mac" : [ 4 | { 5 | "name" : "SDWebImage", 6 | "hash" : "2424a5a4b7bbb4743c2045ee160a6722b4b6bad2fd01edde45b3c6d62bbe7991" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Alamofire: -------------------------------------------------------------------------------- 1 | Versions/Current/Alamofire -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire.h 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @import Foundation; 26 | 27 | FOUNDATION_EXPORT double AlamofireVersionNumber; 28 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 29 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Alamofire.Swift { 9 | header "Alamofire-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18B45d 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Alamofire 11 | CFBundleIdentifier 12 | org.alamofire.Alamofire 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Alamofire 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.7.3 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 10A254a 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 18A384 37 | DTSDKName 38 | macosx10.14 39 | DTXcode 40 | 1000 41 | DTXcodeBuild 42 | 10A254a 43 | UIDeviceFamily 44 | 45 | 1 46 | 2 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/Alamofire.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/SDWebImage: -------------------------------------------------------------------------------- 1 | Versions/Current/SDWebImage -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/MKAnnotationView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import 14 | #import "SDWebImageManager.h" 15 | 16 | /** 17 | * Integrates SDWebImage async downloading and caching of remote images with MKAnnotationView. 18 | */ 19 | @interface MKAnnotationView (WebCache) 20 | 21 | /** 22 | * Set the imageView `image` with an `url`. 23 | * 24 | * The download is asynchronous and cached. 25 | * 26 | * @param url The url for the image. 27 | */ 28 | - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 29 | 30 | /** 31 | * Set the imageView `image` with an `url` and a placeholder. 32 | * 33 | * The download is asynchronous and cached. 34 | * 35 | * @param url The url for the image. 36 | * @param placeholder The image to be set initially, until the image request finishes. 37 | * @see sd_setImageWithURL:placeholderImage:options: 38 | */ 39 | - (void)sd_setImageWithURL:(nullable NSURL *)url 40 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 41 | 42 | /** 43 | * Set the imageView `image` with an `url`, placeholder and custom options. 44 | * 45 | * The download is asynchronous and cached. 46 | * 47 | * @param url The url for the image. 48 | * @param placeholder The image to be set initially, until the image request finishes. 49 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 50 | */ 51 | 52 | - (void)sd_setImageWithURL:(nullable NSURL *)url 53 | placeholderImage:(nullable UIImage *)placeholder 54 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 55 | 56 | /** 57 | * Set the imageView `image` with an `url`. 58 | * 59 | * The download is asynchronous and cached. 60 | * 61 | * @param url The url for the image. 62 | * @param completedBlock A block called when operation has been completed. This block has no return value 63 | * and takes the requested UIImage as first parameter. In case of error the image parameter 64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 65 | * indicating if the image was retrieved from the local cache or from the network. 66 | * The fourth parameter is the original image url. 67 | */ 68 | - (void)sd_setImageWithURL:(nullable NSURL *)url 69 | completed:(nullable SDExternalCompletionBlock)completedBlock; 70 | 71 | /** 72 | * Set the imageView `image` with an `url`, placeholder. 73 | * 74 | * The download is asynchronous and cached. 75 | * 76 | * @param url The url for the image. 77 | * @param placeholder The image to be set initially, until the image request finishes. 78 | * @param completedBlock A block called when operation has been completed. This block has no return value 79 | * and takes the requested UIImage as first parameter. In case of error the image parameter 80 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 81 | * indicating if the image was retrieved from the local cache or from the network. 82 | * The fourth parameter is the original image url. 83 | */ 84 | - (void)sd_setImageWithURL:(nullable NSURL *)url 85 | placeholderImage:(nullable UIImage *)placeholder 86 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 87 | 88 | /** 89 | * Set the imageView `image` with an `url`, placeholder and custom options. 90 | * 91 | * The download is asynchronous and cached. 92 | * 93 | * @param url The url for the image. 94 | * @param placeholder The image to be set initially, until the image request finishes. 95 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 96 | * @param completedBlock A block called when operation has been completed. This block has no return value 97 | * and takes the requested UIImage as first parameter. In case of error the image parameter 98 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 99 | * indicating if the image was retrieved from the local cache or from the network. 100 | * The fourth parameter is the original image url. 101 | */ 102 | - (void)sd_setImageWithURL:(nullable NSURL *)url 103 | placeholderImage:(nullable UIImage *)placeholder 104 | options:(SDWebImageOptions)options 105 | completed:(nullable SDExternalCompletionBlock)completedBlock; 106 | 107 | @end 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | @interface NSButton (WebCache) 16 | 17 | #pragma mark - Image 18 | 19 | /** 20 | * Get the current image URL. 21 | */ 22 | - (nullable NSURL *)sd_currentImageURL; 23 | 24 | /** 25 | * Set the button `image` with an `url`. 26 | * 27 | * The download is asynchronous and cached. 28 | * 29 | * @param url The url for the image. 30 | */ 31 | - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 32 | 33 | /** 34 | * Set the button `image` with an `url` and a placeholder. 35 | * 36 | * The download is asynchronous and cached. 37 | * 38 | * @param url The url for the image. 39 | * @param placeholder The image to be set initially, until the image request finishes. 40 | * @see sd_setImageWithURL:placeholderImage:options: 41 | */ 42 | - (void)sd_setImageWithURL:(nullable NSURL *)url 43 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 44 | 45 | /** 46 | * Set the button `image` with an `url`, placeholder and custom options. 47 | * 48 | * The download is asynchronous and cached. 49 | * 50 | * @param url The url for the image. 51 | * @param placeholder The image to be set initially, until the image request finishes. 52 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 53 | */ 54 | - (void)sd_setImageWithURL:(nullable NSURL *)url 55 | placeholderImage:(nullable UIImage *)placeholder 56 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 57 | 58 | /** 59 | * Set the button `image` with an `url`. 60 | * 61 | * The download is asynchronous and cached. 62 | * 63 | * @param url The url for the image. 64 | * @param completedBlock A block called when operation has been completed. This block has no return value 65 | * and takes the requested UIImage as first parameter. In case of error the image parameter 66 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 67 | * indicating if the image was retrieved from the local cache or from the network. 68 | * The fourth parameter is the original image url. 69 | */ 70 | - (void)sd_setImageWithURL:(nullable NSURL *)url 71 | completed:(nullable SDExternalCompletionBlock)completedBlock; 72 | 73 | /** 74 | * Set the button `image` with an `url`, placeholder. 75 | * 76 | * The download is asynchronous and cached. 77 | * 78 | * @param url The url for the image. 79 | * @param placeholder The image to be set initially, until the image request finishes. 80 | * @param completedBlock A block called when operation has been completed. This block has no return value 81 | * and takes the requested UIImage as first parameter. In case of error the image parameter 82 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 83 | * indicating if the image was retrieved from the local cache or from the network. 84 | * The fourth parameter is the original image url. 85 | */ 86 | - (void)sd_setImageWithURL:(nullable NSURL *)url 87 | placeholderImage:(nullable UIImage *)placeholder 88 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 89 | 90 | /** 91 | * Set the button `image` with an `url`, placeholder and custom options. 92 | * 93 | * The download is asynchronous and cached. 94 | * 95 | * @param url The url for the image. 96 | * @param placeholder The image to be set initially, until the image request finishes. 97 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 98 | * @param completedBlock A block called when operation has been completed. This block has no return value 99 | * and takes the requested UIImage as first parameter. In case of error the image parameter 100 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 101 | * indicating if the image was retrieved from the local cache or from the network. 102 | * The fourth parameter is the original image url. 103 | */ 104 | - (void)sd_setImageWithURL:(nullable NSURL *)url 105 | placeholderImage:(nullable UIImage *)placeholder 106 | options:(SDWebImageOptions)options 107 | completed:(nullable SDExternalCompletionBlock)completedBlock; 108 | 109 | /** 110 | * Set the button `image` with an `url`, placeholder and custom options. 111 | * 112 | * The download is asynchronous and cached. 113 | * 114 | * @param url The url for the image. 115 | * @param placeholder The image to be set initially, until the image request finishes. 116 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 117 | * @param progressBlock A block called while image is downloading 118 | * @note the progress block is executed on a background queue 119 | * @param completedBlock A block called when operation has been completed. This block has no return value 120 | * and takes the requested UIImage as first parameter. In case of error the image parameter 121 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 122 | * indicating if the image was retrieved from the local cache or from the network. 123 | * The fourth parameter is the original image url. 124 | */ 125 | - (void)sd_setImageWithURL:(nullable NSURL *)url 126 | placeholderImage:(nullable UIImage *)placeholder 127 | options:(SDWebImageOptions)options 128 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 129 | completed:(nullable SDExternalCompletionBlock)completedBlock; 130 | 131 | #pragma mark - Alternate Image 132 | 133 | /** 134 | * Get the current alternateImage URL. 135 | */ 136 | - (nullable NSURL *)sd_currentAlternateImageURL; 137 | 138 | /** 139 | * Set the button `alternateImage` with an `url`. 140 | * 141 | * The download is asynchronous and cached. 142 | * 143 | * @param url The url for the alternateImage. 144 | */ 145 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 146 | 147 | /** 148 | * Set the button `alternateImage` with an `url` and a placeholder. 149 | * 150 | * The download is asynchronous and cached. 151 | * 152 | * @param url The url for the alternateImage. 153 | * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. 154 | * @see sd_setAlternateImageWithURL:placeholderImage:options: 155 | */ 156 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 157 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 158 | 159 | /** 160 | * Set the button `alternateImage` with an `url`, placeholder and custom options. 161 | * 162 | * The download is asynchronous and cached. 163 | * 164 | * @param url The url for the alternateImage. 165 | * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. 166 | * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. 167 | */ 168 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 169 | placeholderImage:(nullable UIImage *)placeholder 170 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 171 | 172 | /** 173 | * Set the button `alternateImage` with an `url`. 174 | * 175 | * The download is asynchronous and cached. 176 | * 177 | * @param url The url for the alternateImage. 178 | * @param completedBlock A block called when operation has been completed. This block has no return value 179 | * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter 180 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 181 | * indicating if the alternateImage was retrieved from the local cache or from the network. 182 | * The fourth parameter is the original alternateImage url. 183 | */ 184 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 185 | completed:(nullable SDExternalCompletionBlock)completedBlock; 186 | 187 | /** 188 | * Set the button `alternateImage` with an `url`, placeholder. 189 | * 190 | * The download is asynchronous and cached. 191 | * 192 | * @param url The url for the alternateImage. 193 | * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. 194 | * @param completedBlock A block called when operation has been completed. This block has no return value 195 | * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter 196 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 197 | * indicating if the alternateImage was retrieved from the local cache or from the network. 198 | * The fourth parameter is the original alternateImage url. 199 | */ 200 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 201 | placeholderImage:(nullable UIImage *)placeholder 202 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 203 | 204 | /** 205 | * Set the button `alternateImage` with an `url`, placeholder and custom options. 206 | * 207 | * The download is asynchronous and cached. 208 | * 209 | * @param url The url for the alternateImage. 210 | * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. 211 | * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. 212 | * @param completedBlock A block called when operation has been completed. This block has no return value 213 | * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter 214 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 215 | * indicating if the alternateImage was retrieved from the local cache or from the network. 216 | * The fourth parameter is the original alternateImage url. 217 | */ 218 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 219 | placeholderImage:(nullable UIImage *)placeholder 220 | options:(SDWebImageOptions)options 221 | completed:(nullable SDExternalCompletionBlock)completedBlock; 222 | 223 | /** 224 | * Set the button `alternateImage` with an `url`, placeholder and custom options. 225 | * 226 | * The download is asynchronous and cached. 227 | * 228 | * @param url The url for the alternateImage. 229 | * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. 230 | * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. 231 | * @param progressBlock A block called while alternateImage is downloading 232 | * @note the progress block is executed on a background queue 233 | * @param completedBlock A block called when operation has been completed. This block has no return value 234 | * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter 235 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 236 | * indicating if the alternateImage was retrieved from the local cache or from the network. 237 | * The fourth parameter is the original alternateImage url. 238 | */ 239 | - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url 240 | placeholderImage:(nullable UIImage *)placeholder 241 | options:(SDWebImageOptions)options 242 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 243 | completed:(nullable SDExternalCompletionBlock)completedBlock; 244 | 245 | #pragma mark - Cancel 246 | 247 | /** 248 | * Cancel the current image download 249 | */ 250 | - (void)sd_cancelCurrentImageLoad; 251 | 252 | /** 253 | * Cancel the current alternateImage download 254 | */ 255 | - (void)sd_cancelCurrentAlternateImageLoad; 256 | 257 | @end 258 | 259 | #endif 260 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP, 20 | SDImageFormatHEIC 21 | }; 22 | 23 | @interface NSData (ImageContentType) 24 | 25 | /** 26 | * Return image format 27 | * 28 | * @param data the input image data 29 | * 30 | * @return the image format as `SDImageFormat` (enum) 31 | */ 32 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 33 | 34 | /** 35 | * Convert SDImageFormat to UTType 36 | * 37 | * @param format Format as SDImageFormat 38 | * @return The UTType as CFStringRef 39 | */ 40 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; 41 | 42 | /** 43 | * Convert UTTyppe to SDImageFormat 44 | * 45 | * @param uttype The UTType as CFStringRef 46 | * @return The Format as SDImageFormat 47 | */ 48 | + (SDImageFormat)sd_imageFormatFromUTType:(nonnull CFStringRef)uttype; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | // A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 14 | // Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDWebImageImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 15 | 16 | @interface SDAnimatedImageRep : NSBitmapImageRep 17 | 18 | @end 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDImageCacheConfig.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageCacheType) { 14 | /** 15 | * The image wasn't available the SDWebImage caches, but was downloaded from the web. 16 | */ 17 | SDImageCacheTypeNone, 18 | /** 19 | * The image was obtained from the disk cache. 20 | */ 21 | SDImageCacheTypeDisk, 22 | /** 23 | * The image was obtained from the memory cache. 24 | */ 25 | SDImageCacheTypeMemory 26 | }; 27 | 28 | typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) { 29 | /** 30 | * By default, we do not query disk data when the image is cached in memory. This mask can force to query disk data at the same time. 31 | */ 32 | SDImageCacheQueryDataWhenInMemory = 1 << 0, 33 | /** 34 | * By default, we query the memory cache synchronously, disk cache asynchronously. This mask can force to query disk cache synchronously. 35 | */ 36 | SDImageCacheQueryDiskSync = 1 << 1, 37 | /** 38 | * By default, images are decoded respecting their original size. On iOS, this flag will scale down the 39 | * images to a size compatible with the constrained memory of devices. 40 | */ 41 | SDImageCacheScaleDownLargeImages = 1 << 2 42 | }; 43 | 44 | typedef void(^SDCacheQueryCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType); 45 | 46 | typedef void(^SDWebImageCheckCacheCompletionBlock)(BOOL isInCache); 47 | 48 | typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize); 49 | 50 | 51 | /** 52 | * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed 53 | * asynchronous so it doesn’t add unnecessary latency to the UI. 54 | */ 55 | @interface SDImageCache : NSObject 56 | 57 | #pragma mark - Properties 58 | 59 | /** 60 | * Cache Config object - storing all kind of settings 61 | */ 62 | @property (nonatomic, nonnull, readonly) SDImageCacheConfig *config; 63 | 64 | /** 65 | * The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory. 66 | */ 67 | @property (assign, nonatomic) NSUInteger maxMemoryCost; 68 | 69 | /** 70 | * The maximum number of objects the cache should hold. 71 | */ 72 | @property (assign, nonatomic) NSUInteger maxMemoryCountLimit; 73 | 74 | #pragma mark - Singleton and initialization 75 | 76 | /** 77 | * Returns global shared cache instance 78 | * 79 | * @return SDImageCache global instance 80 | */ 81 | + (nonnull instancetype)sharedImageCache; 82 | 83 | /** 84 | * Init a new cache store with a specific namespace 85 | * 86 | * @param ns The namespace to use for this cache store 87 | */ 88 | - (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns; 89 | 90 | /** 91 | * Init a new cache store with a specific namespace and directory 92 | * 93 | * @param ns The namespace to use for this cache store 94 | * @param directory Directory to cache disk images in 95 | */ 96 | - (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns 97 | diskCacheDirectory:(nonnull NSString *)directory NS_DESIGNATED_INITIALIZER; 98 | 99 | #pragma mark - Cache paths 100 | 101 | - (nullable NSString *)makeDiskCachePath:(nonnull NSString*)fullNamespace; 102 | 103 | /** 104 | * Add a read-only cache path to search for images pre-cached by SDImageCache 105 | * Useful if you want to bundle pre-loaded images with your app 106 | * 107 | * @param path The path to use for this read-only cache path 108 | */ 109 | - (void)addReadOnlyCachePath:(nonnull NSString *)path; 110 | 111 | #pragma mark - Store Ops 112 | 113 | /** 114 | * Asynchronously store an image into memory and disk cache at the given key. 115 | * 116 | * @param image The image to store 117 | * @param key The unique image cache key, usually it's image absolute URL 118 | * @param completionBlock A block executed after the operation is finished 119 | */ 120 | - (void)storeImage:(nullable UIImage *)image 121 | forKey:(nullable NSString *)key 122 | completion:(nullable SDWebImageNoParamsBlock)completionBlock; 123 | 124 | /** 125 | * Asynchronously store an image into memory and disk cache at the given key. 126 | * 127 | * @param image The image to store 128 | * @param key The unique image cache key, usually it's image absolute URL 129 | * @param toDisk Store the image to disk cache if YES 130 | * @param completionBlock A block executed after the operation is finished 131 | */ 132 | - (void)storeImage:(nullable UIImage *)image 133 | forKey:(nullable NSString *)key 134 | toDisk:(BOOL)toDisk 135 | completion:(nullable SDWebImageNoParamsBlock)completionBlock; 136 | 137 | /** 138 | * Asynchronously store an image into memory and disk cache at the given key. 139 | * 140 | * @param image The image to store 141 | * @param imageData The image data as returned by the server, this representation will be used for disk storage 142 | * instead of converting the given image object into a storable/compressed image format in order 143 | * to save quality and CPU 144 | * @param key The unique image cache key, usually it's image absolute URL 145 | * @param toDisk Store the image to disk cache if YES 146 | * @param completionBlock A block executed after the operation is finished 147 | */ 148 | - (void)storeImage:(nullable UIImage *)image 149 | imageData:(nullable NSData *)imageData 150 | forKey:(nullable NSString *)key 151 | toDisk:(BOOL)toDisk 152 | completion:(nullable SDWebImageNoParamsBlock)completionBlock; 153 | 154 | /** 155 | * Synchronously store image NSData into disk cache at the given key. 156 | * 157 | * 158 | * @param imageData The image data to store 159 | * @param key The unique image cache key, usually it's image absolute URL 160 | */ 161 | - (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key; 162 | 163 | #pragma mark - Query and Retrieve Ops 164 | 165 | /** 166 | * Async check if image exists in disk cache already (does not load the image) 167 | * 168 | * @param key the key describing the url 169 | * @param completionBlock the block to be executed when the check is done. 170 | * @note the completion block will be always executed on the main queue 171 | */ 172 | - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; 173 | 174 | /** 175 | * Sync check if image data exists in disk cache already (does not load the image) 176 | * 177 | * @param key the key describing the url 178 | */ 179 | - (BOOL)diskImageDataExistsWithKey:(nullable NSString *)key; 180 | 181 | /** 182 | * Query the image data for the given key synchronously. 183 | * 184 | * @param key The unique key used to store the wanted image 185 | * @return The image data for the given key, or nil if not found. 186 | */ 187 | - (nullable NSData *)diskImageDataForKey:(nullable NSString *)key; 188 | 189 | /** 190 | * Operation that queries the cache asynchronously and call the completion when done. 191 | * 192 | * @param key The unique key used to store the wanted image 193 | * @param doneBlock The completion block. Will not get called if the operation is cancelled 194 | * 195 | * @return a NSOperation instance containing the cache op 196 | */ 197 | - (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; 198 | 199 | /** 200 | * Operation that queries the cache asynchronously and call the completion when done. 201 | * 202 | * @param key The unique key used to store the wanted image 203 | * @param options A mask to specify options to use for this cache query 204 | * @param doneBlock The completion block. Will not get called if the operation is cancelled 205 | * 206 | * @return a NSOperation instance containing the cache op 207 | */ 208 | - (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key options:(SDImageCacheOptions)options done:(nullable SDCacheQueryCompletedBlock)doneBlock; 209 | 210 | /** 211 | * Query the memory cache synchronously. 212 | * 213 | * @param key The unique key used to store the image 214 | * @return The image for the given key, or nil if not found. 215 | */ 216 | - (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key; 217 | 218 | /** 219 | * Query the disk cache synchronously. 220 | * 221 | * @param key The unique key used to store the image 222 | * @return The image for the given key, or nil if not found. 223 | */ 224 | - (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key; 225 | 226 | /** 227 | * Query the cache (memory and or disk) synchronously after checking the memory cache. 228 | * 229 | * @param key The unique key used to store the image 230 | * @return The image for the given key, or nil if not found. 231 | */ 232 | - (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key; 233 | 234 | #pragma mark - Remove Ops 235 | 236 | /** 237 | * Remove the image from memory and disk cache asynchronously 238 | * 239 | * @param key The unique image cache key 240 | * @param completion A block that should be executed after the image has been removed (optional) 241 | */ 242 | - (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion; 243 | 244 | /** 245 | * Remove the image from memory and optionally disk cache asynchronously 246 | * 247 | * @param key The unique image cache key 248 | * @param fromDisk Also remove cache entry from disk if YES 249 | * @param completion A block that should be executed after the image has been removed (optional) 250 | */ 251 | - (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion; 252 | 253 | #pragma mark - Cache clean Ops 254 | 255 | /** 256 | * Clear all memory cached images 257 | */ 258 | - (void)clearMemory; 259 | 260 | /** 261 | * Async clear all disk cached images. Non-blocking method - returns immediately. 262 | * @param completion A block that should be executed after cache expiration completes (optional) 263 | */ 264 | - (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion; 265 | 266 | /** 267 | * Async remove all expired cached image from disk. Non-blocking method - returns immediately. 268 | * @param completionBlock A block that should be executed after cache expiration completes (optional) 269 | */ 270 | - (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock; 271 | 272 | #pragma mark - Cache Info 273 | 274 | /** 275 | * Get the size used by the disk cache 276 | */ 277 | - (NSUInteger)getSize; 278 | 279 | /** 280 | * Get the number of images in the disk cache 281 | */ 282 | - (NSUInteger)getDiskCount; 283 | 284 | /** 285 | * Asynchronously calculate the disk cache's size. 286 | */ 287 | - (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock; 288 | 289 | #pragma mark - Cache Paths 290 | 291 | /** 292 | * Get the cache path for a certain key (needs the cache path root folder) 293 | * 294 | * @param key the key (can be obtained from url using cacheKeyForURL) 295 | * @param path the cache path root folder 296 | * 297 | * @return the cache path 298 | */ 299 | - (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path; 300 | 301 | /** 302 | * Get the default cache path for a certain key 303 | * 304 | * @param key the key (can be obtained from url using cacheKeyForURL) 305 | * 306 | * @return the default cache path 307 | */ 308 | - (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key; 309 | 310 | @end 311 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) { 13 | /** 14 | * When the image is accessed it will update this value 15 | */ 16 | SDImageCacheConfigExpireTypeAccessDate, 17 | /** 18 | * The image was obtained from the disk cache (Default) 19 | */ 20 | SDImageCacheConfigExpireTypeModificationDate 21 | }; 22 | 23 | @interface SDImageCacheConfig : NSObject 24 | 25 | /** 26 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 27 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 28 | */ 29 | @property (assign, nonatomic) BOOL shouldDecompressImages; 30 | 31 | /** 32 | * Whether or not to disable iCloud backup 33 | * Defaults to YES. 34 | */ 35 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 36 | 37 | /** 38 | * Whether or not to use memory cache 39 | * @note When the memory cache is disabled, the weak memory cache will also be disabled. 40 | * Defaults to YES. 41 | */ 42 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 43 | 44 | /** 45 | * The option to control weak memory cache for images. When enable, `SDImageCache`'s memory cache will use a weak maptable to store the image at the same time when it stored to memory, and get removed at the same time. 46 | * However when memory warning is triggered, since the weak maptable does not hold a strong reference to image instacnce, even when the memory cache itself is purged, some images which are held strongly by UIImageViews or other live instances can be recovered again, to avoid later re-query from disk cache or network. This may be helpful for the case, for example, when app enter background and memory is purged, cause cell flashing after re-enter foreground. 47 | * Defautls to YES. You can change this option dynamically. 48 | */ 49 | @property (assign, nonatomic) BOOL shouldUseWeakMemoryCache; 50 | 51 | /** 52 | * The reading options while reading cache from disk. 53 | * Defaults to 0. You can set this to `NSDataReadingMappedIfSafe` to improve performance. 54 | */ 55 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; 56 | 57 | /** 58 | * The writing options while writing cache to disk. 59 | * Defaults to `NSDataWritingAtomic`. You can set this to `NSDataWritingWithoutOverwriting` to prevent overwriting an existing file. 60 | */ 61 | @property (assign, nonatomic) NSDataWritingOptions diskCacheWritingOptions; 62 | 63 | /** 64 | * The maximum length of time to keep an image in the cache, in seconds. 65 | */ 66 | @property (assign, nonatomic) NSInteger maxCacheAge; 67 | 68 | /** 69 | * The maximum size of the cache, in bytes. 70 | */ 71 | @property (assign, nonatomic) NSUInteger maxCacheSize; 72 | 73 | /** 74 | * The attribute which the clear cache will be checked against when clearing the disk cache 75 | * Default is Modified Date 76 | */ 77 | @property (assign, nonatomic) SDImageCacheConfigExpireType diskCacheExpireType; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Florent Vilmart 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #if SD_UIKIT 13 | #import 14 | #endif 15 | 16 | //! Project version number for WebImage. 17 | FOUNDATION_EXPORT double WebImageVersionNumber; 18 | 19 | //! Project version string for WebImage. 20 | FOUNDATION_EXPORT const unsigned char WebImageVersionString[]; 21 | 22 | // In this header, you should import all the public headers of your framework using statements like #import 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | 39 | #if SD_MAC || SD_UIKIT 40 | #import 41 | #endif 42 | 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | 55 | #if SD_MAC 56 | #import 57 | #import 58 | #import 59 | #endif 60 | 61 | #if SD_UIKIT 62 | #import 63 | 64 | #if __has_include() 65 | #import 66 | #endif 67 | 68 | #if __has_include() 69 | #import 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "NSData+ImageContentType.h" 12 | 13 | /** 14 | A Boolean value indicating whether to scale down large images during decompressing. (NSNumber) 15 | */ 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageCoderScaleDownLargeImagesKey; 17 | 18 | /** 19 | Return the shared device-dependent RGB color space created with CGColorSpaceCreateDeviceRGB. 20 | 21 | @return The device-dependent RGB color space 22 | */ 23 | CG_EXTERN CGColorSpaceRef _Nonnull SDCGColorSpaceGetDeviceRGB(void); 24 | 25 | /** 26 | Check whether CGImageRef contains alpha channel. 27 | 28 | @param imageRef The CGImageRef 29 | @return Return YES if CGImageRef contains alpha channel, otherwise return NO 30 | */ 31 | CG_EXTERN BOOL SDCGImageRefContainsAlpha(_Nullable CGImageRef imageRef); 32 | 33 | 34 | /** 35 | This is the image coder protocol to provide custom image decoding/encoding. 36 | These methods are all required to implement. 37 | @note Pay attention that these methods are not called from main queue. 38 | */ 39 | @protocol SDWebImageCoder 40 | 41 | @required 42 | #pragma mark - Decoding 43 | /** 44 | Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder. 45 | 46 | @param data The image data so we can look at it 47 | @return YES if this coder can decode the data, NO otherwise 48 | */ 49 | - (BOOL)canDecodeFromData:(nullable NSData *)data; 50 | 51 | /** 52 | Decode the image data to image. 53 | 54 | @param data The image data to be decoded 55 | @return The decoded image from data 56 | */ 57 | - (nullable UIImage *)decodedImageWithData:(nullable NSData *)data; 58 | 59 | /** 60 | Decompress the image with original image and image data. 61 | 62 | @param image The original image to be decompressed 63 | @param data The pointer to original image data. The pointer itself is nonnull but image data can be null. This data will set to cache if needed. If you do not need to modify data at the sametime, ignore this param. 64 | @param optionsDict A dictionary containing any decompressing options. Pass {SDWebImageCoderScaleDownLargeImagesKey: @(YES)} to scale down large images 65 | @return The decompressed image 66 | */ 67 | - (nullable UIImage *)decompressedImageWithImage:(nullable UIImage *)image 68 | data:(NSData * _Nullable * _Nonnull)data 69 | options:(nullable NSDictionary*)optionsDict; 70 | 71 | #pragma mark - Encoding 72 | 73 | /** 74 | Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder. 75 | 76 | @param format The image format 77 | @return YES if this coder can encode the image, NO otherwise 78 | */ 79 | - (BOOL)canEncodeToFormat:(SDImageFormat)format; 80 | 81 | /** 82 | Encode the image to image data. 83 | 84 | @param image The image to be encoded 85 | @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible 86 | @return The encoded image data 87 | */ 88 | - (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image format:(SDImageFormat)format; 89 | 90 | @end 91 | 92 | 93 | /** 94 | This is the image coder protocol to provide custom progressive image decoding. 95 | These methods are all required to implement. 96 | @note Pay attention that these methods are not called from main queue. 97 | */ 98 | @protocol SDWebImageProgressiveCoder 99 | 100 | @required 101 | /** 102 | Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder. 103 | 104 | @param data The image data so we can look at it 105 | @return YES if this coder can decode the data, NO otherwise 106 | */ 107 | - (BOOL)canIncrementallyDecodeFromData:(nullable NSData *)data; 108 | 109 | /** 110 | Incremental decode the image data to image. 111 | 112 | @param data The image data has been downloaded so far 113 | @param finished Whether the download has finished 114 | @warning because incremental decoding need to keep the decoded context, we will alloc a new instance with the same class for each download operation to avoid conflicts 115 | @return The decoded image from data 116 | */ 117 | - (nullable UIImage *)incrementallyDecodedImageWithData:(nullable NSData *)data finished:(BOOL)finished; 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageFrame.h" 12 | 13 | @interface SDWebImageCoderHelper : NSObject 14 | 15 | /** 16 | Return an animated image with frames array. 17 | For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the average of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work. 18 | For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering. Attention the animated image may loss some detail if the input frames contain full alpha channel because GIF only supports 1 bit alpha channel. (For 1 pixel, either transparent or not) 19 | 20 | @param frames The frames array. If no frames or frames is empty, return nil 21 | @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit) 22 | */ 23 | + (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames; 24 | 25 | /** 26 | Return frames array from an animated image. 27 | For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage. 28 | For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array. 29 | 30 | @param animatedImage A animated image. If it's not animated, return nil 31 | @return The frames array 32 | */ 33 | + (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage; 34 | 35 | #if SD_UIKIT || SD_WATCH 36 | /** 37 | Convert an EXIF image orientation to an iOS one. 38 | 39 | @param exifOrientation EXIF orientation 40 | @return iOS orientation 41 | */ 42 | + (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation; 43 | /** 44 | Convert an iOS orientation to an EXIF image orientation. 45 | 46 | @param imageOrientation iOS orientation 47 | @return EXIF orientation 48 | */ 49 | + (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation; 50 | #endif 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Global object holding the array of coders, so that we avoid passing them from object to object. 14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority. 15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. 16 | That way, users can add their custom coders while preserving our existing prebuilt ones 17 | 18 | Note: the `coders` getter will return the coders in their reversed order 19 | Example: 20 | - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`) 21 | - calling `coders` will return `@[WebPCoder, IOCoder]` 22 | - call `[addCoder:[MyCrazyCoder new]]` 23 | - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]` 24 | 25 | Coders 26 | ------ 27 | A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding 28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` 29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES. 30 | That means that coder can decode that data / encode to that format 31 | */ 32 | @interface SDWebImageCodersManager : NSObject 33 | 34 | /** 35 | Shared reusable instance 36 | */ 37 | + (nonnull instancetype)sharedInstance; 38 | 39 | /** 40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority 41 | */ 42 | @property (nonatomic, copy, readwrite, nullable) NSArray> *coders; 43 | 44 | /** 45 | Add a new coder to the end of coders array. Which has the highest priority. 46 | 47 | @param coder coder 48 | */ 49 | - (void)addCoder:(nonnull id)coder; 50 | 51 | /** 52 | Remove a coder in the coders array. 53 | 54 | @param coder coder 55 | */ 56 | - (void)removeCoder:(nonnull id)coder; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | // Apple's defines from TargetConditionals.h are a bit weird. 17 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 18 | // To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms 19 | #if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH 20 | #define SD_MAC 1 21 | #else 22 | #define SD_MAC 0 23 | #endif 24 | 25 | // iOS and tvOS are very similar, UIKit exists on both platforms 26 | // Note: watchOS also has UIKit, but it's very limited 27 | #if TARGET_OS_IOS || TARGET_OS_TV 28 | #define SD_UIKIT 1 29 | #else 30 | #define SD_UIKIT 0 31 | #endif 32 | 33 | #if TARGET_OS_IOS 34 | #define SD_IOS 1 35 | #else 36 | #define SD_IOS 0 37 | #endif 38 | 39 | #if TARGET_OS_TV 40 | #define SD_TV 1 41 | #else 42 | #define SD_TV 0 43 | #endif 44 | 45 | #if TARGET_OS_WATCH 46 | #define SD_WATCH 1 47 | #else 48 | #define SD_WATCH 0 49 | #endif 50 | 51 | 52 | #if SD_MAC 53 | #import 54 | #ifndef UIImage 55 | #define UIImage NSImage 56 | #endif 57 | #ifndef UIImageView 58 | #define UIImageView NSImageView 59 | #endif 60 | #ifndef UIView 61 | #define UIView NSView 62 | #endif 63 | #else 64 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 65 | #error SDWebImage doesn't support Deployment Target version < 5.0 66 | #endif 67 | 68 | #if SD_UIKIT 69 | #import 70 | #endif 71 | #if SD_WATCH 72 | #import 73 | #ifndef UIView 74 | #define UIView WKInterfaceObject 75 | #endif 76 | #ifndef UIImageView 77 | #define UIImageView WKInterfaceImage 78 | #endif 79 | #endif 80 | #endif 81 | 82 | #ifndef NS_ENUM 83 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 84 | #endif 85 | 86 | #ifndef NS_OPTIONS 87 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 88 | #endif 89 | 90 | FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 91 | 92 | typedef void(^SDWebImageNoParamsBlock)(void); 93 | 94 | FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; 95 | 96 | #ifndef dispatch_queue_async_safe 97 | #define dispatch_queue_async_safe(queue, block)\ 98 | if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(queue)) {\ 99 | block();\ 100 | } else {\ 101 | dispatch_async(queue, block);\ 102 | } 103 | #endif 104 | 105 | #ifndef dispatch_main_async_safe 106 | #define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) 107 | #endif 108 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { 14 | /** 15 | * Put the download in the low queue priority and task priority. 16 | */ 17 | SDWebImageDownloaderLowPriority = 1 << 0, 18 | 19 | /** 20 | * This flag enables progressive download, the image is displayed progressively during download as a browser would do. 21 | */ 22 | SDWebImageDownloaderProgressiveDownload = 1 << 1, 23 | 24 | /** 25 | * By default, request prevent the use of NSURLCache. With this flag, NSURLCache 26 | * is used with default policies. 27 | */ 28 | SDWebImageDownloaderUseNSURLCache = 1 << 2, 29 | 30 | /** 31 | * Call completion block with nil image/imageData if the image was read from NSURLCache 32 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`). 33 | */ 34 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, 35 | 36 | /** 37 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for 38 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled. 39 | */ 40 | SDWebImageDownloaderContinueInBackground = 1 << 4, 41 | 42 | /** 43 | * Handles cookies stored in NSHTTPCookieStore by setting 44 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES; 45 | */ 46 | SDWebImageDownloaderHandleCookies = 1 << 5, 47 | 48 | /** 49 | * Enable to allow untrusted SSL certificates. 50 | * Useful for testing purposes. Use with caution in production. 51 | */ 52 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, 53 | 54 | /** 55 | * Put the download in the high queue priority and task priority. 56 | */ 57 | SDWebImageDownloaderHighPriority = 1 << 7, 58 | 59 | /** 60 | * Scale down the image 61 | */ 62 | SDWebImageDownloaderScaleDownLargeImages = 1 << 8, 63 | }; 64 | 65 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { 66 | /** 67 | * Default value. All download operations will execute in queue style (first-in-first-out). 68 | */ 69 | SDWebImageDownloaderFIFOExecutionOrder, 70 | 71 | /** 72 | * All download operations will execute in stack style (last-in-first-out). 73 | */ 74 | SDWebImageDownloaderLIFOExecutionOrder 75 | }; 76 | 77 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; 78 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; 79 | 80 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL); 81 | 82 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished); 83 | 84 | typedef NSDictionary SDHTTPHeadersDictionary; 85 | typedef NSMutableDictionary SDHTTPHeadersMutableDictionary; 86 | 87 | typedef SDHTTPHeadersDictionary * _Nullable (^SDWebImageDownloaderHeadersFilterBlock)(NSURL * _Nullable url, SDHTTPHeadersDictionary * _Nullable headers); 88 | 89 | /** 90 | * A token associated with each download. Can be used to cancel a download 91 | */ 92 | @interface SDWebImageDownloadToken : NSObject 93 | 94 | /** 95 | The download's URL. This should be readonly and you should not modify 96 | */ 97 | @property (nonatomic, strong, nullable) NSURL *url; 98 | /** 99 | The cancel token taken from `addHandlersForProgress:completed`. This should be readonly and you should not modify 100 | @note use `-[SDWebImageDownloadToken cancel]` to cancel the token 101 | */ 102 | @property (nonatomic, strong, nullable) id downloadOperationCancelToken; 103 | 104 | @end 105 | 106 | 107 | /** 108 | * Asynchronous downloader dedicated and optimized for image loading. 109 | */ 110 | @interface SDWebImageDownloader : NSObject 111 | 112 | /** 113 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 114 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 115 | */ 116 | @property (assign, nonatomic) BOOL shouldDecompressImages; 117 | 118 | /** 119 | * The maximum number of concurrent downloads 120 | */ 121 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads; 122 | 123 | /** 124 | * Shows the current amount of downloads that still need to be downloaded 125 | */ 126 | @property (readonly, nonatomic) NSUInteger currentDownloadCount; 127 | 128 | /** 129 | * The timeout value (in seconds) for the download operation. Default: 15.0. 130 | */ 131 | @property (assign, nonatomic) NSTimeInterval downloadTimeout; 132 | 133 | /** 134 | * The configuration in use by the internal NSURLSession. 135 | * Mutating this object directly has no effect. 136 | * 137 | * @see createNewSessionWithConfiguration: 138 | */ 139 | @property (readonly, nonatomic, nonnull) NSURLSessionConfiguration *sessionConfiguration; 140 | 141 | 142 | /** 143 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. 144 | */ 145 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; 146 | 147 | /** 148 | * Singleton method, returns the shared instance 149 | * 150 | * @return global shared instance of downloader class 151 | */ 152 | + (nonnull instancetype)sharedDownloader; 153 | 154 | /** 155 | * Set the default URL credential to be set for request operations. 156 | */ 157 | @property (strong, nonatomic, nullable) NSURLCredential *urlCredential; 158 | 159 | /** 160 | * Set username 161 | */ 162 | @property (strong, nonatomic, nullable) NSString *username; 163 | 164 | /** 165 | * Set password 166 | */ 167 | @property (strong, nonatomic, nullable) NSString *password; 168 | 169 | /** 170 | * Set filter to pick headers for downloading image HTTP request. 171 | * 172 | * This block will be invoked for each downloading image request, returned 173 | * NSDictionary will be used as headers in corresponding HTTP request. 174 | */ 175 | @property (nonatomic, copy, nullable) SDWebImageDownloaderHeadersFilterBlock headersFilter; 176 | 177 | /** 178 | * Creates an instance of a downloader with specified session configuration. 179 | * @note `timeoutIntervalForRequest` is going to be overwritten. 180 | * @return new instance of downloader class 181 | */ 182 | - (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER; 183 | 184 | /** 185 | * Set a value for a HTTP header to be appended to each download HTTP request. 186 | * 187 | * @param value The value for the header field. Use `nil` value to remove the header. 188 | * @param field The name of the header field to set. 189 | */ 190 | - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field; 191 | 192 | /** 193 | * Returns the value of the specified HTTP header field. 194 | * 195 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field. 196 | */ 197 | - (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field; 198 | 199 | /** 200 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default 201 | * `NSOperation` to be used each time SDWebImage constructs a request 202 | * operation to download an image. 203 | * 204 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set 205 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. 206 | */ 207 | - (void)setOperationClass:(nullable Class)operationClass; 208 | 209 | /** 210 | * Creates a SDWebImageDownloader async downloader instance with a given URL 211 | * 212 | * The delegate will be informed when the image is finish downloaded or an error has happen. 213 | * 214 | * @see SDWebImageDownloaderDelegate 215 | * 216 | * @param url The URL to the image to download 217 | * @param options The options to be used for this download 218 | * @param progressBlock A block called repeatedly while the image is downloading 219 | * @note the progress block is executed on a background queue 220 | * @param completedBlock A block called once the download is completed. 221 | * If the download succeeded, the image parameter is set, in case of error, 222 | * error parameter is set with the error. The last parameter is always YES 223 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the 224 | * SDWebImageDownloaderProgressiveDownload option, this block is called 225 | * repeatedly with the partial image object and the finished argument set to NO 226 | * before to be called a last time with the full image and finished argument 227 | * set to YES. In case of error, the finished argument is always YES. 228 | * 229 | * @return A token (SDWebImageDownloadToken) that can be passed to -cancel: to cancel this operation 230 | */ 231 | - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url 232 | options:(SDWebImageDownloaderOptions)options 233 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 234 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 235 | 236 | /** 237 | * Cancels a download that was previously queued using -downloadImageWithURL:options:progress:completed: 238 | * 239 | * @param token The token received from -downloadImageWithURL:options:progress:completed: that should be canceled. 240 | */ 241 | - (void)cancel:(nullable SDWebImageDownloadToken *)token; 242 | 243 | /** 244 | * Sets the download queue suspension state 245 | */ 246 | - (void)setSuspended:(BOOL)suspended; 247 | 248 | /** 249 | * Cancels all download operations in the queue 250 | */ 251 | - (void)cancelAllDownloads; 252 | 253 | /** 254 | * Forces SDWebImageDownloader to create and use a new NSURLSession that is 255 | * initialized with the given configuration. 256 | * @note All existing download operations in the queue will be cancelled. 257 | * @note `timeoutIntervalForRequest` is going to be overwritten. 258 | * 259 | * @param sessionConfiguration The configuration to use for the new NSURLSession 260 | */ 261 | - (void)createNewSessionWithConfiguration:(nonnull NSURLSessionConfiguration *)sessionConfiguration; 262 | 263 | /** 264 | * Invalidates the managed session, optionally canceling pending operations. 265 | * @note If you use custom downloader instead of the shared downloader, you need call this method when you do not use it to avoid memory leak 266 | * @param cancelPendingOperations Whether or not to cancel pending operations. 267 | * @note Calling this method on the shared downloader has no effect. 268 | */ 269 | - (void)invalidateSessionAndCancel:(BOOL)cancelPendingOperations; 270 | 271 | @end 272 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; 14 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; 15 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; 17 | 18 | 19 | 20 | /** 21 | Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol 22 | For the description about these methods, see `SDWebImageDownloaderOperation` 23 | */ 24 | @protocol SDWebImageDownloaderOperationInterface 25 | 26 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 27 | inSession:(nullable NSURLSession *)session 28 | options:(SDWebImageDownloaderOptions)options; 29 | 30 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 31 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 32 | 33 | - (BOOL)shouldDecompressImages; 34 | - (void)setShouldDecompressImages:(BOOL)value; 35 | 36 | - (nullable NSURLCredential *)credential; 37 | - (void)setCredential:(nullable NSURLCredential *)value; 38 | 39 | - (BOOL)cancel:(nullable id)token; 40 | 41 | @end 42 | 43 | 44 | @interface SDWebImageDownloaderOperation : NSOperation 45 | 46 | /** 47 | * The request used by the operation's task. 48 | */ 49 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request; 50 | 51 | /** 52 | * The operation's task 53 | */ 54 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask; 55 | 56 | 57 | @property (assign, nonatomic) BOOL shouldDecompressImages; 58 | 59 | /** 60 | * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection. 61 | * @deprecated Not used for a couple of versions 62 | */ 63 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility"); 64 | 65 | /** 66 | * The credential used for authentication challenges in `-URLSession:task:didReceiveChallenge:completionHandler:`. 67 | * 68 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 69 | */ 70 | @property (nonatomic, strong, nullable) NSURLCredential *credential; 71 | 72 | /** 73 | * The SDWebImageDownloaderOptions for the receiver. 74 | */ 75 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 76 | 77 | /** 78 | * The expected size of data. 79 | */ 80 | @property (assign, nonatomic) NSInteger expectedSize; 81 | 82 | /** 83 | * The response returned by the operation's task. 84 | */ 85 | @property (strong, nonatomic, nullable) NSURLResponse *response; 86 | 87 | /** 88 | * Initializes a `SDWebImageDownloaderOperation` object 89 | * 90 | * @see SDWebImageDownloaderOperation 91 | * 92 | * @param request the URL request 93 | * @param session the URL session in which this operation will run 94 | * @param options downloader options 95 | * 96 | * @return the initialized instance 97 | */ 98 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 99 | inSession:(nullable NSURLSession *)session 100 | options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER; 101 | 102 | /** 103 | * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of 104 | * callbacks. 105 | * 106 | * @param progressBlock the block executed when a new chunk of data arrives. 107 | * @note the progress block is executed on a background queue 108 | * @param completedBlock the block executed when the download is done. 109 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 110 | * 111 | * @return the token to use to cancel this set of handlers 112 | */ 113 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 114 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 115 | 116 | /** 117 | * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. 118 | * 119 | * @param token the token representing a set of callbacks to cancel 120 | * 121 | * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise. 122 | */ 123 | - (BOOL)cancel:(nullable id)token; 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWebImageFrame : NSObject 13 | 14 | // This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attention if you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat`. 15 | 16 | /** 17 | The image of current frame. You should not set an animated image. 18 | */ 19 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 20 | /** 21 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 22 | */ 23 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 24 | 25 | /** 26 | Create a frame instance with specify image and duration 27 | 28 | @param image current frame's image 29 | @param duration current frame's duration 30 | @return frame instance 31 | */ 32 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports GIF encoding/decoding 14 | @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` 16 | @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` 17 | @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying 18 | */ 19 | @interface SDWebImageGIFCoder : NSObject 20 | 21 | + (nonnull instancetype)sharedCoder; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDWebImageImageIOCoder : NSObject 27 | 28 | + (nonnull instancetype)sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageOperation.h" 11 | #import "SDWebImageDownloader.h" 12 | #import "SDImageCache.h" 13 | 14 | typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) { 15 | /** 16 | * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying. 17 | * This flag disable this blacklisting. 18 | */ 19 | SDWebImageRetryFailed = 1 << 0, 20 | 21 | /** 22 | * By default, image downloads are started during UI interactions, this flags disable this feature, 23 | * leading to delayed download on UIScrollView deceleration for instance. 24 | */ 25 | SDWebImageLowPriority = 1 << 1, 26 | 27 | /** 28 | * This flag disables on-disk caching after the download finished, only cache in memory 29 | */ 30 | SDWebImageCacheMemoryOnly = 1 << 2, 31 | 32 | /** 33 | * This flag enables progressive download, the image is displayed progressively during download as a browser would do. 34 | * By default, the image is only displayed once completely downloaded. 35 | */ 36 | SDWebImageProgressiveDownload = 1 << 3, 37 | 38 | /** 39 | * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. 40 | * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. 41 | * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. 42 | * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. 43 | * 44 | * Use this flag only if you can't make your URLs static with embedded cache busting parameter. 45 | */ 46 | SDWebImageRefreshCached = 1 << 4, 47 | 48 | /** 49 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for 50 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled. 51 | */ 52 | SDWebImageContinueInBackground = 1 << 5, 53 | 54 | /** 55 | * Handles cookies stored in NSHTTPCookieStore by setting 56 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES; 57 | */ 58 | SDWebImageHandleCookies = 1 << 6, 59 | 60 | /** 61 | * Enable to allow untrusted SSL certificates. 62 | * Useful for testing purposes. Use with caution in production. 63 | */ 64 | SDWebImageAllowInvalidSSLCertificates = 1 << 7, 65 | 66 | /** 67 | * By default, images are loaded in the order in which they were queued. This flag moves them to 68 | * the front of the queue. 69 | */ 70 | SDWebImageHighPriority = 1 << 8, 71 | 72 | /** 73 | * By default, placeholder images are loaded while the image is loading. This flag will delay the loading 74 | * of the placeholder image until after the image has finished loading. 75 | */ 76 | SDWebImageDelayPlaceholder = 1 << 9, 77 | 78 | /** 79 | * We usually don't call transformDownloadedImage delegate method on animated images, 80 | * as most transformation code would mangle it. 81 | * Use this flag to transform them anyway. 82 | */ 83 | SDWebImageTransformAnimatedImage = 1 << 10, 84 | 85 | /** 86 | * By default, image is added to the imageView after download. But in some cases, we want to 87 | * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) 88 | * Use this flag if you want to manually set the image in the completion when success 89 | */ 90 | SDWebImageAvoidAutoSetImage = 1 << 11, 91 | 92 | /** 93 | * By default, images are decoded respecting their original size. On iOS, this flag will scale down the 94 | * images to a size compatible with the constrained memory of devices. 95 | * If `SDWebImageProgressiveDownload` flag is set the scale down is deactivated. 96 | */ 97 | SDWebImageScaleDownLargeImages = 1 << 12, 98 | 99 | /** 100 | * By default, we do not query disk data when the image is cached in memory. This mask can force to query disk data at the same time. 101 | * This flag is recommend to be used with `SDWebImageQueryDiskSync` to ensure the image is loaded in the same runloop. 102 | */ 103 | SDWebImageQueryDataWhenInMemory = 1 << 13, 104 | 105 | /** 106 | * By default, we query the memory cache synchronously, disk cache asynchronously. This mask can force to query disk cache synchronously to ensure that image is loaded in the same runloop. 107 | * This flag can avoid flashing during cell reuse if you disable memory cache or in some other cases. 108 | */ 109 | SDWebImageQueryDiskSync = 1 << 14, 110 | 111 | /** 112 | * By default, when the cache missed, the image is download from the network. This flag can prevent network to load from cache only. 113 | */ 114 | SDWebImageFromCacheOnly = 1 << 15, 115 | /** 116 | * By default, when you use `SDWebImageTransition` to do some view transition after the image load finished, this transition is only applied for image download from the network. This mask can force to apply view transition for memory and disk cache as well. 117 | */ 118 | SDWebImageForceTransition = 1 << 16 119 | }; 120 | 121 | typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL); 122 | 123 | typedef void(^SDInternalCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL); 124 | 125 | typedef NSString * _Nullable(^SDWebImageCacheKeyFilterBlock)(NSURL * _Nullable url); 126 | 127 | typedef NSData * _Nullable(^SDWebImageCacheSerializerBlock)(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL); 128 | 129 | 130 | @class SDWebImageManager; 131 | 132 | @protocol SDWebImageManagerDelegate 133 | 134 | @optional 135 | 136 | /** 137 | * Controls which image should be downloaded when the image is not found in the cache. 138 | * 139 | * @param imageManager The current `SDWebImageManager` 140 | * @param imageURL The url of the image to be downloaded 141 | * 142 | * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied. 143 | */ 144 | - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldDownloadImageForURL:(nullable NSURL *)imageURL; 145 | 146 | /** 147 | * Controls the complicated logic to mark as failed URLs when download error occur. 148 | * If the delegate implement this method, we will not use the built-in way to mark URL as failed based on error code; 149 | @param imageManager The current `SDWebImageManager` 150 | @param imageURL The url of the image 151 | @param error The download error for the url 152 | @return Whether to block this url or not. Return YES to mark this URL as failed. 153 | */ 154 | - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldBlockFailedURL:(nonnull NSURL *)imageURL withError:(nonnull NSError *)error; 155 | 156 | /** 157 | * Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. 158 | * NOTE: This method is called from a global queue in order to not to block the main thread. 159 | * 160 | * @param imageManager The current `SDWebImageManager` 161 | * @param image The image to transform 162 | * @param imageURL The url of the image to transform 163 | * 164 | * @return The transformed image object. 165 | */ 166 | - (nullable UIImage *)imageManager:(nonnull SDWebImageManager *)imageManager transformDownloadedImage:(nullable UIImage *)image withURL:(nullable NSURL *)imageURL; 167 | 168 | @end 169 | 170 | /** 171 | * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes. 172 | * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache). 173 | * You can use this class directly to benefit from web image downloading with caching in another context than 174 | * a UIView. 175 | * 176 | * Here is a simple example of how to use SDWebImageManager: 177 | * 178 | * @code 179 | 180 | SDWebImageManager *manager = [SDWebImageManager sharedManager]; 181 | [manager loadImageWithURL:imageURL 182 | options:0 183 | progress:nil 184 | completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 185 | if (image) { 186 | // do something with image 187 | } 188 | }]; 189 | 190 | * @endcode 191 | */ 192 | @interface SDWebImageManager : NSObject 193 | 194 | @property (weak, nonatomic, nullable) id delegate; 195 | 196 | @property (strong, nonatomic, readonly, nullable) SDImageCache *imageCache; 197 | @property (strong, nonatomic, readonly, nullable) SDWebImageDownloader *imageDownloader; 198 | 199 | /** 200 | * The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can 201 | * be used to remove dynamic part of an image URL. 202 | * 203 | * The following example sets a filter in the application delegate that will remove any query-string from the 204 | * URL before to use it as a cache key: 205 | * 206 | * @code 207 | 208 | SDWebImageManager.sharedManager.cacheKeyFilter = ^(NSURL * _Nullable url) { 209 | url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; 210 | return [url absoluteString]; 211 | }; 212 | 213 | * @endcode 214 | */ 215 | @property (nonatomic, copy, nullable) SDWebImageCacheKeyFilterBlock cacheKeyFilter; 216 | 217 | /** 218 | * The cache serializer is a block used to convert the decoded image, the source downloaded data, to the actual data used for storing to the disk cache. If you return nil, means to generate the data from the image instance, see `SDImageCache`. 219 | * For example, if you are using WebP images and facing the slow decoding time issue when later retriving from disk cache again. You can try to encode the decoded image to JPEG/PNG format to disk cache instead of source downloaded data. 220 | * @note The `image` arg is nonnull, but when you also provide a image transformer and the image is transformed, the `data` arg may be nil, take attention to this case. 221 | * @note This method is called from a global queue in order to not to block the main thread. 222 | * @code 223 | SDWebImageManager.sharedManager.cacheSerializer = ^NSData * _Nullable(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL) { 224 | SDImageFormat format = [NSData sd_imageFormatForImageData:data]; 225 | switch (format) { 226 | case SDImageFormatWebP: 227 | return image.images ? data : nil; 228 | default: 229 | return data; 230 | } 231 | }; 232 | * @endcode 233 | * The default value is nil. Means we just store the source downloaded data to disk cache. 234 | */ 235 | @property (nonatomic, copy, nullable) SDWebImageCacheSerializerBlock cacheSerializer; 236 | 237 | /** 238 | * Returns global SDWebImageManager instance. 239 | * 240 | * @return SDWebImageManager shared instance 241 | */ 242 | + (nonnull instancetype)sharedManager; 243 | 244 | /** 245 | * Allows to specify instance of cache and image downloader used with image manager. 246 | * @return new instance of `SDWebImageManager` with specified cache and downloader. 247 | */ 248 | - (nonnull instancetype)initWithCache:(nonnull SDImageCache *)cache downloader:(nonnull SDWebImageDownloader *)downloader NS_DESIGNATED_INITIALIZER; 249 | 250 | /** 251 | * Downloads the image at the given URL if not present in cache or return the cached version otherwise. 252 | * 253 | * @param url The URL to the image 254 | * @param options A mask to specify options to use for this request 255 | * @param progressBlock A block called while image is downloading 256 | * @note the progress block is executed on a background queue 257 | * @param completedBlock A block called when operation has been completed. 258 | * 259 | * This parameter is required. 260 | * 261 | * This block has no return value and takes the requested UIImage as first parameter and the NSData representation as second parameter. 262 | * In case of error the image parameter is nil and the third parameter may contain an NSError. 263 | * 264 | * The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache 265 | * or from the memory cache or from the network. 266 | * 267 | * The fith parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is 268 | * downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the 269 | * block is called a last time with the full image and the last parameter set to YES. 270 | * 271 | * The last parameter is the original image URL 272 | * 273 | * @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation 274 | */ 275 | - (nullable id )loadImageWithURL:(nullable NSURL *)url 276 | options:(SDWebImageOptions)options 277 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 278 | completed:(nullable SDInternalCompletionBlock)completedBlock; 279 | 280 | /** 281 | * Saves image to cache for given URL 282 | * 283 | * @param image The image to cache 284 | * @param url The URL to the image 285 | * 286 | */ 287 | 288 | - (void)saveImageToCache:(nullable UIImage *)image forURL:(nullable NSURL *)url; 289 | 290 | /** 291 | * Cancel all current operations 292 | */ 293 | - (void)cancelAll; 294 | 295 | /** 296 | * Check one or more operations running 297 | */ 298 | - (BOOL)isRunning; 299 | 300 | /** 301 | * Async check if image has already been cached 302 | * 303 | * @param url image url 304 | * @param completionBlock the block to be executed when the check is finished 305 | * 306 | * @note the completion block is always executed on the main queue 307 | */ 308 | - (void)cachedImageExistsForURL:(nullable NSURL *)url 309 | completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; 310 | 311 | /** 312 | * Async check if image has already been cached on disk only 313 | * 314 | * @param url image url 315 | * @param completionBlock the block to be executed when the check is finished 316 | * 317 | * @note the completion block is always executed on the main queue 318 | */ 319 | - (void)diskImageExistsForURL:(nullable NSURL *)url 320 | completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; 321 | 322 | 323 | /** 324 | *Return the cache key for a given URL 325 | */ 326 | - (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url; 327 | 328 | @end 329 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (strong, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic, nullable) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (nonnull instancetype)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list. 82 | * Any previously-running prefetch operations are canceled. 83 | * 84 | * @param urls list of URLs to prefetch 85 | */ 86 | - (void)prefetchURLs:(nullable NSArray *)urls; 87 | 88 | /** 89 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 90 | * currently one image is downloaded at a time, 91 | * and skips images for failed downloads and proceed to the next image in the list. 92 | * Any previously-running prefetch operations are canceled. 93 | * 94 | * @param urls list of URLs to prefetch 95 | * @param progressBlock block to be called when progress updates; 96 | * first parameter is the number of completed (successful or not) requests, 97 | * second parameter is the total number of images originally requested to be prefetched 98 | * @param completionBlock block to be called when prefetching is completed 99 | * first param is the number of completed (successful or not) requests, 100 | * second parameter is the number of skipped requests 101 | */ 102 | - (void)prefetchURLs:(nullable NSArray *)urls 103 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock 104 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; 105 | 106 | /** 107 | * Remove and cancel queued list 108 | */ 109 | - (void)cancelPrefetching; 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | #import "SDImageCache.h" 13 | 14 | // This class is used to provide a transition animation after the view category load image finished. Use this on `sd_imageTransition` in UIView+WebCache.h 15 | // for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation. 16 | // for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block. 17 | // These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use `SDWebImageAvoidAutoSetImage` and implement your own after image load finished. 18 | 19 | #if SD_UIKIT 20 | typedef UIViewAnimationOptions SDWebImageAnimationOptions; 21 | #else 22 | typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) { 23 | SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext` 24 | }; 25 | #endif 26 | 27 | typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL); 28 | typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image); 29 | typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); 30 | 31 | @interface SDWebImageTransition : NSObject 32 | 33 | /** 34 | By default, we set the image to the view at the beginning of the animtions. You can disable this and provide custom set image process 35 | */ 36 | @property (nonatomic, assign) BOOL avoidAutoSetImage; 37 | /** 38 | The duration of the transition animation, measured in seconds. Defaults to 0.5. 39 | */ 40 | @property (nonatomic, assign) NSTimeInterval duration; 41 | /** 42 | The timing function used for all animations within this transition animation (macOS). 43 | */ 44 | @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction NS_AVAILABLE_MAC(10_7); 45 | /** 46 | A mask of options indicating how you want to perform the animations. 47 | */ 48 | @property (nonatomic, assign) SDWebImageAnimationOptions animationOptions; 49 | /** 50 | A block object to be executed before the animation sequence starts. 51 | */ 52 | @property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares; 53 | /** 54 | A block object that contains the changes you want to make to the specified view. 55 | */ 56 | @property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations; 57 | /** 58 | A block object to be executed when the animation sequence ends. 59 | */ 60 | @property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion; 61 | 62 | @end 63 | 64 | // Convenience way to create transition. Remember to specify the duration if needed. 65 | // for UIKit, these transition just use the correspond `animationOptions`. By default we enable `UIViewAnimationOptionAllowUserInteraction` to allow user interaction during transition. 66 | // for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it. 67 | 68 | @interface SDWebImageTransition (Conveniences) 69 | 70 | // class property is available in Xcode 8. We will drop the Xcode 7.3 support in 5.x 71 | #if __has_feature(objc_class_property) 72 | /// Fade transition. 73 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition; 74 | /// Flip from left transition. 75 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition; 76 | /// Flip from right transition. 77 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromRightTransition; 78 | /// Flip from top transition. 79 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromTopTransition; 80 | /// Flip from bottom transition. 81 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromBottomTransition; 82 | /// Curl up transition. 83 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition; 84 | /// Curl down transition. 85 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition; 86 | #else 87 | + (nonnull instancetype)fadeTransition; 88 | + (nonnull instancetype)flipFromLeftTransition; 89 | + (nonnull instancetype)flipFromRightTransition; 90 | + (nonnull instancetype)flipFromTopTransition; 91 | + (nonnull instancetype)flipFromBottomTransition; 92 | + (nonnull instancetype)curlUpTransition; 93 | + (nonnull instancetype)curlDownTransition; 94 | #endif 95 | 96 | @end 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageWebPCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #ifdef SD_WEBP 10 | 11 | #import 12 | #import "SDWebImageCoder.h" 13 | 14 | /** 15 | Built in coder that supports WebP and animated WebP 16 | */ 17 | @interface SDWebImageWebPCoder : NSObject 18 | 19 | + (nonnull instancetype)sharedCoder; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | /** 16 | * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. 17 | */ 18 | @interface UIButton (WebCache) 19 | 20 | #pragma mark - Image 21 | 22 | /** 23 | * Get the current image URL. 24 | */ 25 | - (nullable NSURL *)sd_currentImageURL; 26 | 27 | /** 28 | * Get the image URL for a control state. 29 | * 30 | * @param state Which state you want to know the URL for. The values are described in UIControlState. 31 | */ 32 | - (nullable NSURL *)sd_imageURLForState:(UIControlState)state; 33 | 34 | /** 35 | * Set the imageView `image` with an `url`. 36 | * 37 | * The download is asynchronous and cached. 38 | * 39 | * @param url The url for the image. 40 | * @param state The state that uses the specified title. The values are described in UIControlState. 41 | */ 42 | - (void)sd_setImageWithURL:(nullable NSURL *)url 43 | forState:(UIControlState)state NS_REFINED_FOR_SWIFT; 44 | 45 | /** 46 | * Set the imageView `image` with an `url` and a placeholder. 47 | * 48 | * The download is asynchronous and cached. 49 | * 50 | * @param url The url for the image. 51 | * @param state The state that uses the specified title. The values are described in UIControlState. 52 | * @param placeholder The image to be set initially, until the image request finishes. 53 | * @see sd_setImageWithURL:placeholderImage:options: 54 | */ 55 | - (void)sd_setImageWithURL:(nullable NSURL *)url 56 | forState:(UIControlState)state 57 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 58 | 59 | /** 60 | * Set the imageView `image` with an `url`, placeholder and custom options. 61 | * 62 | * The download is asynchronous and cached. 63 | * 64 | * @param url The url for the image. 65 | * @param state The state that uses the specified title. The values are described in UIControlState. 66 | * @param placeholder The image to be set initially, until the image request finishes. 67 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 68 | */ 69 | - (void)sd_setImageWithURL:(nullable NSURL *)url 70 | forState:(UIControlState)state 71 | placeholderImage:(nullable UIImage *)placeholder 72 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 73 | 74 | /** 75 | * Set the imageView `image` with an `url`. 76 | * 77 | * The download is asynchronous and cached. 78 | * 79 | * @param url The url for the image. 80 | * @param state The state that uses the specified title. The values are described in UIControlState. 81 | * @param completedBlock A block called when operation has been completed. This block has no return value 82 | * and takes the requested UIImage as first parameter. In case of error the image parameter 83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 84 | * indicating if the image was retrieved from the local cache or from the network. 85 | * The fourth parameter is the original image url. 86 | */ 87 | - (void)sd_setImageWithURL:(nullable NSURL *)url 88 | forState:(UIControlState)state 89 | completed:(nullable SDExternalCompletionBlock)completedBlock; 90 | 91 | /** 92 | * Set the imageView `image` with an `url`, placeholder. 93 | * 94 | * The download is asynchronous and cached. 95 | * 96 | * @param url The url for the image. 97 | * @param state The state that uses the specified title. The values are described in UIControlState. 98 | * @param placeholder The image to be set initially, until the image request finishes. 99 | * @param completedBlock A block called when operation has been completed. This block has no return value 100 | * and takes the requested UIImage as first parameter. In case of error the image parameter 101 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 102 | * indicating if the image was retrieved from the local cache or from the network. 103 | * The fourth parameter is the original image url. 104 | */ 105 | - (void)sd_setImageWithURL:(nullable NSURL *)url 106 | forState:(UIControlState)state 107 | placeholderImage:(nullable UIImage *)placeholder 108 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 109 | 110 | /** 111 | * Set the imageView `image` with an `url`, placeholder and custom options. 112 | * 113 | * The download is asynchronous and cached. 114 | * 115 | * @param url The url for the image. 116 | * @param state The state that uses the specified title. The values are described in UIControlState. 117 | * @param placeholder The image to be set initially, until the image request finishes. 118 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 119 | * @param completedBlock A block called when operation has been completed. This block has no return value 120 | * and takes the requested UIImage as first parameter. In case of error the image parameter 121 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 122 | * indicating if the image was retrieved from the local cache or from the network. 123 | * The fourth parameter is the original image url. 124 | */ 125 | - (void)sd_setImageWithURL:(nullable NSURL *)url 126 | forState:(UIControlState)state 127 | placeholderImage:(nullable UIImage *)placeholder 128 | options:(SDWebImageOptions)options 129 | completed:(nullable SDExternalCompletionBlock)completedBlock; 130 | 131 | #pragma mark - Background Image 132 | 133 | /** 134 | * Get the current background image URL. 135 | */ 136 | - (nullable NSURL *)sd_currentBackgroundImageURL; 137 | 138 | /** 139 | * Get the background image URL for a control state. 140 | * 141 | * @param state Which state you want to know the URL for. The values are described in UIControlState. 142 | */ 143 | - (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state; 144 | 145 | /** 146 | * Set the backgroundImageView `image` with an `url`. 147 | * 148 | * The download is asynchronous and cached. 149 | * 150 | * @param url The url for the image. 151 | * @param state The state that uses the specified title. The values are described in UIControlState. 152 | */ 153 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 154 | forState:(UIControlState)state NS_REFINED_FOR_SWIFT; 155 | 156 | /** 157 | * Set the backgroundImageView `image` with an `url` and a placeholder. 158 | * 159 | * The download is asynchronous and cached. 160 | * 161 | * @param url The url for the image. 162 | * @param state The state that uses the specified title. The values are described in UIControlState. 163 | * @param placeholder The image to be set initially, until the image request finishes. 164 | * @see sd_setImageWithURL:placeholderImage:options: 165 | */ 166 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 167 | forState:(UIControlState)state 168 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 169 | 170 | /** 171 | * Set the backgroundImageView `image` with an `url`, placeholder and custom options. 172 | * 173 | * The download is asynchronous and cached. 174 | * 175 | * @param url The url for the image. 176 | * @param state The state that uses the specified title. The values are described in UIControlState. 177 | * @param placeholder The image to be set initially, until the image request finishes. 178 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 179 | */ 180 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 181 | forState:(UIControlState)state 182 | placeholderImage:(nullable UIImage *)placeholder 183 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 184 | 185 | /** 186 | * Set the backgroundImageView `image` with an `url`. 187 | * 188 | * The download is asynchronous and cached. 189 | * 190 | * @param url The url for the image. 191 | * @param state The state that uses the specified title. The values are described in UIControlState. 192 | * @param completedBlock A block called when operation has been completed. This block has no return value 193 | * and takes the requested UIImage as first parameter. In case of error the image parameter 194 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 195 | * indicating if the image was retrieved from the local cache or from the network. 196 | * The fourth parameter is the original image url. 197 | */ 198 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 199 | forState:(UIControlState)state 200 | completed:(nullable SDExternalCompletionBlock)completedBlock; 201 | 202 | /** 203 | * Set the backgroundImageView `image` with an `url`, placeholder. 204 | * 205 | * The download is asynchronous and cached. 206 | * 207 | * @param url The url for the image. 208 | * @param state The state that uses the specified title. The values are described in UIControlState. 209 | * @param placeholder The image to be set initially, until the image request finishes. 210 | * @param completedBlock A block called when operation has been completed. This block has no return value 211 | * and takes the requested UIImage as first parameter. In case of error the image parameter 212 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 213 | * indicating if the image was retrieved from the local cache or from the network. 214 | * The fourth parameter is the original image url. 215 | */ 216 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 217 | forState:(UIControlState)state 218 | placeholderImage:(nullable UIImage *)placeholder 219 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 220 | 221 | /** 222 | * Set the backgroundImageView `image` with an `url`, placeholder and custom options. 223 | * 224 | * The download is asynchronous and cached. 225 | * 226 | * @param url The url for the image. 227 | * @param placeholder The image to be set initially, until the image request finishes. 228 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 229 | * @param completedBlock A block called when operation has been completed. This block has no return value 230 | * and takes the requested UIImage as first parameter. In case of error the image parameter 231 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 232 | * indicating if the image was retrieved from the local cache or from the network. 233 | * The fourth parameter is the original image url. 234 | */ 235 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url 236 | forState:(UIControlState)state 237 | placeholderImage:(nullable UIImage *)placeholder 238 | options:(SDWebImageOptions)options 239 | completed:(nullable SDExternalCompletionBlock)completedBlock; 240 | 241 | #pragma mark - Cancel 242 | 243 | /** 244 | * Cancel the current image download 245 | */ 246 | - (void)sd_cancelImageLoadForState:(UIControlState)state; 247 | 248 | /** 249 | * Cancel the current backgroundImage download 250 | */ 251 | - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; 252 | 253 | @end 254 | 255 | #endif 256 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIImage (ForceDecode) 12 | 13 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 14 | 15 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Creates an animated UIImage from an NSData. 16 | * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. 17 | */ 18 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 19 | 20 | /** 21 | * Checks if an UIImage instance is a GIF. Will use the `images` array. 22 | */ 23 | - (BOOL)isGIF; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | /** 15 | * UIKit: 16 | * For static image format, this value is always 0. 17 | * For animated image format, 0 means infinite looping. 18 | * @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 19 | * AppKit: 20 | * NSImage currently only support animated via GIF imageRep unlike UIImage. 21 | * The getter of this property will get the loop count from GIF imageRep 22 | * The setter of this property will set the loop count from GIF imageRep 23 | */ 24 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount; 25 | 26 | /** 27 | * The image format represent the original compressed image data format. 28 | * If you don't manually specify a format, this information is retrieve from CGImage using `CGImageGetUTType`, which may return nil for non-CG based image. At this time it will return `SDImageFormatUndefined` as default value. 29 | * @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 30 | */ 31 | @property (nonatomic, assign) SDImageFormat sd_imageFormat; 32 | 33 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 34 | - (nullable NSData *)sd_imageData; 35 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+WebP.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #ifdef SD_WEBP 10 | 11 | #import "SDWebImageCompat.h" 12 | 13 | @interface UIImage (WebP) 14 | 15 | /** 16 | * Get the current WebP image loop count, the default value is 0. 17 | * For static WebP image, the value is 0. 18 | * For animated WebP image, 0 means repeat the animation indefinitely. 19 | * Note that because of the limitations of categories this property can get out of sync 20 | * if you create another instance with CGImage or other methods. 21 | * @return WebP image loop count 22 | * @deprecated use `sd_imageLoopCount` instead. 23 | */ 24 | - (NSInteger)sd_webpLoopCount __deprecated_msg("Method deprecated. Use `sd_imageLoopCount` in `UIImage+MultiFormat.h`"); 25 | 26 | + (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data; 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | /** 16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 17 | */ 18 | @interface UIImageView (HighlightedWebCache) 19 | 20 | /** 21 | * Set the imageView `highlightedImage` with an `url`. 22 | * 23 | * The download is asynchronous and cached. 24 | * 25 | * @param url The url for the image. 26 | */ 27 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 28 | 29 | /** 30 | * Set the imageView `highlightedImage` with an `url` and custom options. 31 | * 32 | * The download is asynchronous and cached. 33 | * 34 | * @param url The url for the image. 35 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 36 | */ 37 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 38 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 39 | 40 | /** 41 | * Set the imageView `highlightedImage` with an `url`. 42 | * 43 | * The download is asynchronous and cached. 44 | * 45 | * @param url The url for the image. 46 | * @param completedBlock A block called when operation has been completed. This block has no return value 47 | * and takes the requested UIImage as first parameter. In case of error the image parameter 48 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 49 | * indicating if the image was retrieved from the local cache or from the network. 50 | * The fourth parameter is the original image url. 51 | */ 52 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 53 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 54 | 55 | /** 56 | * Set the imageView `highlightedImage` with an `url` and custom options. 57 | * 58 | * The download is asynchronous and cached. 59 | * 60 | * @param url The url for the image. 61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 62 | * @param completedBlock A block called when operation has been completed. This block has no return value 63 | * and takes the requested UIImage as first parameter. In case of error the image parameter 64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 65 | * indicating if the image was retrieved from the local cache or from the network. 66 | * The fourth parameter is the original image url. 67 | */ 68 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 69 | options:(SDWebImageOptions)options 70 | completed:(nullable SDExternalCompletionBlock)completedBlock; 71 | 72 | /** 73 | * Set the imageView `highlightedImage` with an `url` and custom options. 74 | * 75 | * The download is asynchronous and cached. 76 | * 77 | * @param url The url for the image. 78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 79 | * @param progressBlock A block called while image is downloading 80 | * @note the progress block is executed on a background queue 81 | * @param completedBlock A block called when operation has been completed. This block has no return value 82 | * and takes the requested UIImage as first parameter. In case of error the image parameter 83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 84 | * indicating if the image was retrieved from the local cache or from the network. 85 | * The fourth parameter is the original image url. 86 | */ 87 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 88 | options:(SDWebImageOptions)options 89 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 90 | completed:(nullable SDExternalCompletionBlock)completedBlock; 91 | 92 | @end 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageManager.h" 11 | 12 | /** 13 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView. 14 | * 15 | * Usage with a UITableViewCell sub-class: 16 | * 17 | * @code 18 | 19 | #import 20 | 21 | ... 22 | 23 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 24 | { 25 | static NSString *MyIdentifier = @"MyIdentifier"; 26 | 27 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; 28 | 29 | if (cell == nil) { 30 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]; 31 | } 32 | 33 | // Here we use the provided sd_setImageWithURL: method to load the web image 34 | // Ensure you use a placeholder image otherwise cells will be initialized with no image 35 | [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"] 36 | placeholderImage:[UIImage imageNamed:@"placeholder"]]; 37 | 38 | cell.textLabel.text = @"My Text"; 39 | return cell; 40 | } 41 | 42 | * @endcode 43 | */ 44 | @interface UIImageView (WebCache) 45 | 46 | /** 47 | * Set the imageView `image` with an `url`. 48 | * 49 | * The download is asynchronous and cached. 50 | * 51 | * @param url The url for the image. 52 | */ 53 | - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 54 | 55 | /** 56 | * Set the imageView `image` with an `url` and a placeholder. 57 | * 58 | * The download is asynchronous and cached. 59 | * 60 | * @param url The url for the image. 61 | * @param placeholder The image to be set initially, until the image request finishes. 62 | * @see sd_setImageWithURL:placeholderImage:options: 63 | */ 64 | - (void)sd_setImageWithURL:(nullable NSURL *)url 65 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; 66 | 67 | /** 68 | * Set the imageView `image` with an `url`, placeholder and custom options. 69 | * 70 | * The download is asynchronous and cached. 71 | * 72 | * @param url The url for the image. 73 | * @param placeholder The image to be set initially, until the image request finishes. 74 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 75 | */ 76 | - (void)sd_setImageWithURL:(nullable NSURL *)url 77 | placeholderImage:(nullable UIImage *)placeholder 78 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 79 | 80 | /** 81 | * Set the imageView `image` with an `url`. 82 | * 83 | * The download is asynchronous and cached. 84 | * 85 | * @param url The url for the image. 86 | * @param completedBlock A block called when operation has been completed. This block has no return value 87 | * and takes the requested UIImage as first parameter. In case of error the image parameter 88 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 89 | * indicating if the image was retrieved from the local cache or from the network. 90 | * The fourth parameter is the original image url. 91 | */ 92 | - (void)sd_setImageWithURL:(nullable NSURL *)url 93 | completed:(nullable SDExternalCompletionBlock)completedBlock; 94 | 95 | /** 96 | * Set the imageView `image` with an `url`, placeholder. 97 | * 98 | * The download is asynchronous and cached. 99 | * 100 | * @param url The url for the image. 101 | * @param placeholder The image to be set initially, until the image request finishes. 102 | * @param completedBlock A block called when operation has been completed. This block has no return value 103 | * and takes the requested UIImage as first parameter. In case of error the image parameter 104 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 105 | * indicating if the image was retrieved from the local cache or from the network. 106 | * The fourth parameter is the original image url. 107 | */ 108 | - (void)sd_setImageWithURL:(nullable NSURL *)url 109 | placeholderImage:(nullable UIImage *)placeholder 110 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 111 | 112 | /** 113 | * Set the imageView `image` with an `url`, placeholder and custom options. 114 | * 115 | * The download is asynchronous and cached. 116 | * 117 | * @param url The url for the image. 118 | * @param placeholder The image to be set initially, until the image request finishes. 119 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 120 | * @param completedBlock A block called when operation has been completed. This block has no return value 121 | * and takes the requested UIImage as first parameter. In case of error the image parameter 122 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 123 | * indicating if the image was retrieved from the local cache or from the network. 124 | * The fourth parameter is the original image url. 125 | */ 126 | - (void)sd_setImageWithURL:(nullable NSURL *)url 127 | placeholderImage:(nullable UIImage *)placeholder 128 | options:(SDWebImageOptions)options 129 | completed:(nullable SDExternalCompletionBlock)completedBlock; 130 | 131 | /** 132 | * Set the imageView `image` with an `url`, placeholder and custom options. 133 | * 134 | * The download is asynchronous and cached. 135 | * 136 | * @param url The url for the image. 137 | * @param placeholder The image to be set initially, until the image request finishes. 138 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 139 | * @param progressBlock A block called while image is downloading 140 | * @note the progress block is executed on a background queue 141 | * @param completedBlock A block called when operation has been completed. This block has no return value 142 | * and takes the requested UIImage as first parameter. In case of error the image parameter 143 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 144 | * indicating if the image was retrieved from the local cache or from the network. 145 | * The fourth parameter is the original image url. 146 | */ 147 | - (void)sd_setImageWithURL:(nullable NSURL *)url 148 | placeholderImage:(nullable UIImage *)placeholder 149 | options:(SDWebImageOptions)options 150 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 151 | completed:(nullable SDExternalCompletionBlock)completedBlock; 152 | 153 | /** 154 | * Set the imageView `image` with an `url` and custom options. The placeholder image is from previous cached image and will use the provided one instead if the query failed. 155 | * This method was designed to ensure that placeholder and query cache process happened in the same runloop to avoid flashing on cell during two `setImage:` call. But it's really misunderstanding and deprecated. 156 | * This can be done by using `sd_setImageWithURL:` with `SDWebImageQueryDiskSync`. But take care that if the memory cache missed, query disk cache synchronously may reduce the frame rate 157 | * 158 | * The download is asynchronous and cached. 159 | * 160 | * @param url The url for the image. 161 | * @param placeholder The image to be set initially, until the image request finishes. 162 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 163 | * @param progressBlock A block called while image is downloading 164 | * @note the progress block is executed on a background queue 165 | * @param completedBlock A block called when operation has been completed. This block has no return value 166 | * and takes the requested UIImage as first parameter. In case of error the image parameter 167 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 168 | * indicating if the image was retrieved from the local cache or from the network. 169 | * The fourth parameter is the original image url. 170 | * @deprecated consider using `SDWebImageQueryDiskSync` options with `sd_setImageWithURL:` instead 171 | */ 172 | - (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url 173 | placeholderImage:(nullable UIImage *)placeholder 174 | options:(SDWebImageOptions)options 175 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 176 | completed:(nullable SDExternalCompletionBlock)completedBlock __deprecated_msg("This method is misunderstanding and deprecated, consider using `SDWebImageQueryDiskSync` options with `sd_setImageWithURL:` instead"); 177 | 178 | #if SD_UIKIT 179 | 180 | #pragma mark - Animation of multiple images 181 | 182 | /** 183 | * Download an array of images and starts them in an animation loop 184 | * 185 | * @param arrayOfURLs An array of NSURL 186 | */ 187 | - (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs; 188 | 189 | - (void)sd_cancelCurrentAnimationImagesLoad; 190 | 191 | #endif 192 | 193 | @end 194 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageManager.h" 11 | #import "SDWebImageTransition.h" 12 | 13 | /** 14 | A Dispatch group to maintain setImageBlock and completionBlock. This key should be used only internally and may be changed in the future. (dispatch_group_t) 15 | */ 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageInternalSetImageGroupKey __deprecated_msg("Key Deprecated. Does nothing. This key should be used only internally"); 17 | /** 18 | A SDWebImageManager instance to control the image download and cache process using in UIImageView+WebCache category and likes. If not provided, use the shared manager (SDWebImageManager) 19 | */ 20 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageExternalCustomManagerKey; 21 | /** 22 | The value specify that the image progress unit count cannot be determined because the progressBlock is not been called. 23 | */ 24 | FOUNDATION_EXPORT const int64_t SDWebImageProgressUnitCountUnknown; /* 1LL */ 25 | 26 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); 27 | 28 | @interface UIView (WebCache) 29 | 30 | /** 31 | * Get the current image URL. 32 | * 33 | * @note Note that because of the limitations of categories this property can get out of sync if you use setImage: directly. 34 | */ 35 | - (nullable NSURL *)sd_imageURL; 36 | 37 | /** 38 | * The current image loading progress associated to the view. The unit count is the received size and excepted size of download. 39 | * The `totalUnitCount` and `completedUnitCount` will be reset to 0 after a new image loading start (change from current queue). And they will be set to `SDWebImageProgressUnitCountUnknown` if the progressBlock not been called but the image loading success to mark the progress finished (change from main queue). 40 | * @note You can use Key-Value Observing on the progress, but you should take care that the change to progress is from a background queue during download(the same as progressBlock). If you want to using KVO and update the UI, make sure to dispatch on the main queue. And it's recommand to use some KVO libs like KVOController because it's more safe and easy to use. 41 | * @note The getter will create a progress instance if the value is nil. You can also set a custom progress instance and let it been updated during image loading 42 | * @note Note that because of the limitations of categories this property can get out of sync if you update the progress directly. 43 | */ 44 | @property (nonatomic, strong, null_resettable) NSProgress *sd_imageProgress; 45 | 46 | /** 47 | * Set the imageView `image` with an `url` and optionally a placeholder image. 48 | * 49 | * The download is asynchronous and cached. 50 | * 51 | * @param url The url for the image. 52 | * @param placeholder The image to be set initially, until the image request finishes. 53 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 54 | * @param operationKey A string to be used as the operation key. If nil, will use the class name 55 | * @param setImageBlock Block used for custom set image code 56 | * @param progressBlock A block called while image is downloading 57 | * @note the progress block is executed on a background queue 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrieved from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 65 | placeholderImage:(nullable UIImage *)placeholder 66 | options:(SDWebImageOptions)options 67 | operationKey:(nullable NSString *)operationKey 68 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 69 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 70 | completed:(nullable SDExternalCompletionBlock)completedBlock; 71 | 72 | /** 73 | * Set the imageView `image` with an `url` and optionally a placeholder image. 74 | * 75 | * The download is asynchronous and cached. 76 | * 77 | * @param url The url for the image. 78 | * @param placeholder The image to be set initially, until the image request finishes. 79 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 80 | * @param operationKey A string to be used as the operation key. If nil, will use the class name 81 | * @param setImageBlock Block used for custom set image code 82 | * @param progressBlock A block called while image is downloading 83 | * @note the progress block is executed on a background queue 84 | * @param completedBlock A block called when operation has been completed. This block has no return value 85 | * and takes the requested UIImage as first parameter. In case of error the image parameter 86 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 87 | * indicating if the image was retrieved from the local cache or from the network. 88 | * The fourth parameter is the original image url. 89 | * @param context A context with extra information to perform specify changes or processes. 90 | */ 91 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 92 | placeholderImage:(nullable UIImage *)placeholder 93 | options:(SDWebImageOptions)options 94 | operationKey:(nullable NSString *)operationKey 95 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 96 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 97 | completed:(nullable SDExternalCompletionBlock)completedBlock 98 | context:(nullable NSDictionary *)context; 99 | 100 | /** 101 | * Cancel the current image load 102 | */ 103 | - (void)sd_cancelCurrentImageLoad; 104 | 105 | #if SD_UIKIT || SD_MAC 106 | 107 | #pragma mark - Image Transition 108 | 109 | /** 110 | The image transition when image load finished. See `SDWebImageTransition`. 111 | If you specify nil, do not do transition. Defautls to nil. 112 | */ 113 | @property (nonatomic, strong, nullable) SDWebImageTransition *sd_imageTransition; 114 | 115 | #if SD_UIKIT 116 | 117 | #pragma mark - Activity indicator 118 | 119 | /** 120 | * Show activity UIActivityIndicatorView 121 | */ 122 | - (void)sd_setShowActivityIndicatorView:(BOOL)show; 123 | 124 | /** 125 | * set desired UIActivityIndicatorViewStyle 126 | * 127 | * @param style The style of the UIActivityIndicatorView 128 | */ 129 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; 130 | 131 | - (BOOL)sd_showActivityIndicatorView; 132 | - (void)sd_addActivityIndicator; 133 | - (void)sd_removeActivityIndicator; 134 | 135 | #endif 136 | 137 | #endif 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageOperation.h" 11 | 12 | // These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 13 | // All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 14 | @interface UIView (WebCacheOperation) 15 | 16 | /** 17 | * Set the image load operation (storage in a UIView based weak map table) 18 | * 19 | * @param operation the operation 20 | * @param key key for storing the operation 21 | */ 22 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 23 | 24 | /** 25 | * Cancel all operations for the current UIView and key 26 | * 27 | * @param key key for identifying the operations 28 | */ 29 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 30 | 31 | /** 32 | * Just remove the operations corresponding to the current UIView and key without cancelling them 33 | * 34 | * @param key key for identifying the operations 35 | */ 36 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18B45d 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SDWebImage 11 | CFBundleIdentifier 12 | com.dailymotion.SDWebImage.ios 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SDWebImage 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.4.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 4.4.2 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 10A254a 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 18A384 37 | DTSDKName 38 | macosx10.14 39 | DTXcode 40 | 1000 41 | DTXcodeBuild 42 | 10A254a 43 | 44 | 45 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/A/SDWebImage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/Carthage/Build/Mac/SDWebImage.framework/Versions/A/SDWebImage -------------------------------------------------------------------------------- /Carthage/Build/Mac/SDWebImage.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/xcuserdata/jason.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/xcuserdata/jason.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | uploadIPA.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | uploadIPA.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /uploadIPA.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | uploadIPA.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /uploadIPA/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | 16 | func applicationDidFinishLaunching(_ aNotification: Notification) { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | func applicationWillTerminate(_ aNotification: Notification) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "icon-16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "icon-16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "icon-32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "icon-32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "icon-128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "icon-128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "icon-256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "icon-256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "icon-512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "icon-512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-128.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-128@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-16.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-16@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-256.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-256@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-32.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-32@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-512.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/AppIcon.appiconset/icon-512@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Icon-Arrow-down.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Icon-Arrow-down@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-down.imageset/Icon-Arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-down.imageset/Icon-Arrow-down.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-down.imageset/Icon-Arrow-down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-down.imageset/Icon-Arrow-down@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-hover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Icon-Arrow-hover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Icon-Arrow-hover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-hover.imageset/Icon-Arrow-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-hover.imageset/Icon-Arrow-hover.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-hover.imageset/Icon-Arrow-hover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-hover.imageset/Icon-Arrow-hover@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Icon-Arrow-normal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Icon-Arrow-normal@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-normal.imageset/Icon-Arrow-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-normal.imageset/Icon-Arrow-normal.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-Arrow-normal.imageset/Icon-Arrow-normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-Arrow-normal.imageset/Icon-Arrow-normal@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-choose-hover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Icon-choose-hover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Icon-choose-hover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-choose-hover.imageset/Icon-choose-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-choose-hover.imageset/Icon-choose-hover.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/Icon-choose-hover.imageset/Icon-choose-hover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/Icon-choose-hover.imageset/Icon-choose-hover@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/airplane.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "airplane.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/airplane.imageset/airplane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/airplane.imageset/airplane.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/error.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "error.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/error.imageset/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/error.imageset/error.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-choose-down.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-choose-down@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-down.imageset/icon-choose-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-choose-down.imageset/icon-choose-down.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-down.imageset/icon-choose-down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-choose-down.imageset/icon-choose-down@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-choose-normal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-choose-normal@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-normal.imageset/icon-choose-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-choose-normal.imageset/icon-choose-normal.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-choose-normal.imageset/icon-choose-normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-choose-normal.imageset/icon-choose-normal@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-close-down.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-close-down@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-down.imageset/icon-close-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-close-down.imageset/icon-close-down.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-down.imageset/icon-close-down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-close-down.imageset/icon-close-down@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-close-normal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-close-normal@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-normal.imageset/icon-close-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-close-normal.imageset/icon-close-normal.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-close-normal.imageset/icon-close-normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-close-normal.imageset/icon-close-normal@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-enter-down.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-enter-down@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-down.imageset/icon-enter-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-down.imageset/icon-enter-down.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-down.imageset/icon-enter-down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-down.imageset/icon-enter-down@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-hover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-enter-hover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-enter-hover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-hover.imageset/icon-enter-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-hover.imageset/icon-enter-hover.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-hover.imageset/icon-enter-hover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-hover.imageset/icon-enter-hover@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-enter-normal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-enter-normal@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-normal.imageset/icon-enter-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-normal.imageset/icon-enter-normal.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-normal.imageset/icon-enter-normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-normal.imageset/icon-enter-normal@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-undo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-enter-undo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-enter-undo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-undo.imageset/icon-enter-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-undo.imageset/icon-enter-undo.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/icon-enter-undo.imageset/icon-enter-undo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/icon-enter-undo.imageset/icon-enter-undo@2x.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/pgy.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pyg.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/pgy.imageset/pyg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/pgy.imageset/pyg.png -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/success.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "success.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /uploadIPA/Assets.xcassets/success.imageset/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenjie1219/uploadIPA/79882091a86ef65562f770684077eeae3e40df7e/uploadIPA/Assets.xcassets/success.imageset/success.png -------------------------------------------------------------------------------- /uploadIPA/Common/Common.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Common.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | enum UploadType { 12 | case pgy 13 | case fir 14 | } 15 | 16 | let SelectionChange = Notification.Name("SelectionChange") 17 | -------------------------------------------------------------------------------- /uploadIPA/Extension/HoverButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HoverButton.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class HoverButton: NSButton { 12 | 13 | @IBInspectable var hoverImage:NSImage? 14 | 15 | lazy var hover = false 16 | 17 | var defaultImage:NSImage? 18 | 19 | override func draw(_ dirtyRect: NSRect) { 20 | super.draw(dirtyRect) 21 | 22 | let trackingArea = NSTrackingArea(rect: bounds, options: [.activeInKeyWindow,.mouseEnteredAndExited], owner: self, userInfo: nil) 23 | 24 | addTrackingArea(trackingArea) 25 | // Drawing code here. 26 | } 27 | 28 | override func mouseEntered(with event: NSEvent) { 29 | 30 | if !hover { 31 | defaultImage = image 32 | } 33 | 34 | hover = true 35 | 36 | updateImage() 37 | 38 | } 39 | 40 | override func mouseExited(with event: NSEvent) { 41 | 42 | hover = false 43 | 44 | updateImage() 45 | 46 | } 47 | 48 | 49 | 50 | 51 | func updateImage() { 52 | 53 | if hover { 54 | image = hoverImage 55 | }else{ 56 | image = defaultImage 57 | } 58 | 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /uploadIPA/Extension/NSImage+QRCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSImage+QRCode.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/31. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | extension NSImage{ 12 | 13 | class func generateQRCode(_ text: String,_ width:CGFloat,_ fillImage:NSImage?=nil) -> NSImage? { 14 | 15 | //2.给滤镜设置内容 16 | guard let data = text.data(using: .utf8) else { 17 | return nil 18 | } 19 | 20 | if let filter = CIFilter(name: "CIQRCodeGenerator") { 21 | filter.setValue(data, forKey: "inputMessage") 22 | 23 | //获取生成的二维码 24 | guard let outPutImage = filter.outputImage else { 25 | return nil 26 | } 27 | 28 | let scale = width/outPutImage.extent.width 29 | 30 | let transform = CGAffineTransform(scaleX: scale, y: scale) 31 | 32 | if let output = filter.outputImage?.transformed(by: transform) { 33 | 34 | let rep = NSCIImageRep(ciImage: output) 35 | 36 | let QRCodeImage = NSImage(size: rep.size) 37 | 38 | QRCodeImage.addRepresentation(rep) 39 | 40 | guard let fillImage = fillImage else { 41 | return QRCodeImage 42 | } 43 | 44 | let fillRect = CGRect(x: (width - width/4)/2, y: (width - width/4)/2, width: width/4, height: width/4) 45 | 46 | QRCodeImage.lockFocus() 47 | 48 | fillImage.draw(in: fillRect) 49 | 50 | QRCodeImage.unlockFocus() 51 | 52 | return QRCodeImage 53 | 54 | } 55 | 56 | } 57 | 58 | return nil 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /uploadIPA/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | $(DEVELOPMENT_LANGUAGE) 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIconFile 15 | 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | $(PRODUCT_NAME) 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | 1.0 26 | CFBundleVersion 27 | 1 28 | LSMinimumSystemVersion 29 | $(MACOSX_DEPLOYMENT_TARGET) 30 | NSHumanReadableCopyright 31 | Copyright © 2018 Jason. All rights reserved. 32 | NSMainStoryboardFile 33 | Main 34 | NSPrincipalClass 35 | NSApplication 36 | 37 | 38 | -------------------------------------------------------------------------------- /uploadIPA/Login/Controller/LoginSettingVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginSettingVC.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class LoginSettingVC: NSViewController { 12 | 13 | @IBOutlet weak var keyBtn: NSButton! 14 | 15 | lazy var uploadType = UploadType.pgy 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do view setup here. 20 | } 21 | @IBAction func getTokenClick(_ sender: Any) { 22 | 23 | if uploadType == .pgy { 24 | NSWorkspace.shared.open(URL(string: "https://www.pgyer.com/account/api")!) 25 | }else{ 26 | NSWorkspace.shared.open(URL(string: "https://fir.im/apps/apitoken")!) 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /uploadIPA/Login/Controller/LoginVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginVC.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class LoginVC: NSViewController { 12 | 13 | @IBOutlet weak var logoView: NSImageView! 14 | 15 | @IBOutlet weak var tokenFld: NSTextField! 16 | 17 | lazy var isShow = false 18 | 19 | lazy var keyBtnTitle = "获取Key" 20 | 21 | lazy var uploadType = UploadType.pgy 22 | 23 | lazy var settingVC:LoginSettingVC = { 24 | 25 | let vc = NSStoryboard(name: "Main", bundle: nil).instantiateController(withIdentifier: "login") as! LoginSettingVC 26 | 27 | vc.uploadType = uploadType 28 | 29 | return vc 30 | 31 | }() 32 | 33 | lazy var subWindow:NSWindow = { 34 | 35 | let window = NSWindow(contentRect: CGRect(x: view.window?.frame.origin.x ?? 0, y: (view.window?.frame.origin.y ?? 0) - 76, width: view.window?.frame.width ?? 0, height: 76), styleMask: .titled, backing: .buffered, defer: true) 36 | 37 | window.contentViewController = settingVC 38 | 39 | window.backgroundColor = NSColor(deviceRed: 0.93, green: 0.94, blue: 0.95, alpha: 1) 40 | 41 | return window 42 | 43 | }() 44 | 45 | 46 | } 47 | 48 | 49 | 50 | // MARK: - Click 51 | extension LoginVC{ 52 | 53 | @IBAction func switchClick(_ sender: NSPopUpButton) { 54 | 55 | if sender.selectedTag() == 0 { 56 | logoView.image = #imageLiteral(resourceName: "pgy") 57 | uploadType = .pgy 58 | tokenFld.placeholderString = "请输入API Key" 59 | keyBtnTitle = "获取Key" 60 | if isShow{ 61 | settingVC.keyBtn.title = "获取Key" 62 | } 63 | }else{ 64 | logoView.image = #imageLiteral(resourceName: "airplane") 65 | uploadType = .fir 66 | tokenFld.placeholderString = "请输入API Token" 67 | keyBtnTitle = "获取Token" 68 | if isShow{ 69 | settingVC.keyBtn.title = "获取Token" 70 | } 71 | } 72 | 73 | settingVC.uploadType = uploadType 74 | 75 | } 76 | 77 | 78 | 79 | @IBAction func okClick(_ sender: Any) { 80 | 81 | login() 82 | } 83 | 84 | 85 | 86 | @IBAction func showOrHideSubWindow(_ sender: NSButton) { 87 | 88 | isShow = !isShow 89 | 90 | if isShow { 91 | 92 | view.window?.addChildWindow(subWindow, ordered: .below) 93 | 94 | subWindow.makeKeyAndOrderFront(nil) 95 | 96 | settingVC.keyBtn.title = keyBtnTitle 97 | 98 | }else{ 99 | 100 | subWindow.orderOut(nil) 101 | 102 | } 103 | 104 | } 105 | 106 | } 107 | 108 | 109 | 110 | // MARK: - NSTextFieldDelegate 111 | extension LoginVC:NSTextFieldDelegate{ 112 | 113 | func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool { 114 | if commandSelector == #selector(insertNewline(_:)) { 115 | login() 116 | return true 117 | } 118 | return false 119 | } 120 | 121 | 122 | } 123 | 124 | 125 | 126 | // MARK: - CustomMethod 127 | extension LoginVC{ 128 | 129 | func login() { 130 | 131 | switch uploadType { 132 | 133 | case .pgy: 134 | 135 | let vm = PgyAppVM() 136 | 137 | vm.getApps(apiKey: tokenFld.stringValue) { 138 | 139 | self.showMainWindow(vm.pgyApps as [AnyObject]) 140 | } 141 | 142 | case .fir: 143 | 144 | let vm = FirAppVM() 145 | 146 | vm.getApps(apiToken: tokenFld.stringValue) { 147 | 148 | self.showMainWindow(vm.firApps as [AnyObject]) 149 | 150 | } 151 | 152 | } 153 | 154 | } 155 | 156 | 157 | func showMainWindow(_ apps:[AnyObject]) { 158 | 159 | let mainWindowController = NSStoryboard(name: "MainUI", bundle: nil).instantiateInitialController() as? LoginWindow 160 | 161 | let spitVC = mainWindowController?.contentViewController as? NSSplitViewController 162 | 163 | let leftVC = spitVC?.splitViewItems.first?.viewController as? LeftVC 164 | 165 | let rightVC = spitVC?.splitViewItems.last?.viewController as? RightVC 166 | 167 | rightVC?.uploadType = self.uploadType 168 | 169 | if apps.count == 0 { 170 | 171 | rightVC?.appInfoBox.isHidden = true 172 | 173 | } 174 | 175 | leftVC?.apps = apps 176 | 177 | leftVC?.uploadType = self.uploadType 178 | 179 | mainWindowController?.window?.makeKeyAndOrderFront(nil) 180 | 181 | view.window?.close() 182 | 183 | } 184 | 185 | 186 | } 187 | -------------------------------------------------------------------------------- /uploadIPA/Login/Controller/LoginWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginWindow.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/29. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class LoginWindow: NSWindowController { 12 | 13 | override func windowDidLoad() { 14 | super.windowDidLoad() 15 | 16 | window?.backgroundColor = .white 17 | 18 | window?.isMovableByWindowBackground = true 19 | 20 | window?.center() 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /uploadIPA/Login/Model/FirApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirAppModel.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct FirApp { 12 | 13 | var name:String? 14 | 15 | var bundleID:String? 16 | 17 | var type:String? 18 | 19 | var iconURL:URL? 20 | 21 | var short: String? 22 | 23 | var shortURL: String? { 24 | if let short = short { 25 | return "http://fir.im/\(short)" 26 | }else{ 27 | return nil 28 | } 29 | } 30 | 31 | var masterRelease:appRelease? 32 | 33 | 34 | 35 | init(fromDictionary dictionary: [String:Any]){ 36 | 37 | name = dictionary["name"] as? String 38 | bundleID = dictionary["bundle_id"] as? String 39 | 40 | type = dictionary["type"] as? String 41 | 42 | if let iconURLString = dictionary["icon_url"] as? String { 43 | self.iconURL = URL(string: iconURLString) 44 | } 45 | short = dictionary["short"] as? String 46 | 47 | masterRelease = appRelease(fromDictionary: dictionary["master_release"] as! [String : Any]) 48 | } 49 | 50 | } 51 | 52 | 53 | struct appRelease { 54 | 55 | var build: String? 56 | var version: String? 57 | var createdAt: Date? 58 | 59 | init(fromDictionary dictionary: [String:Any]) { 60 | build = dictionary["build"] as? String 61 | version = dictionary["version"] as? String 62 | createdAt = Date(timeIntervalSince1970: (dictionary["created_at"] as? Double ?? 0)) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /uploadIPA/Login/Model/PgyApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PgyAppModel.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct PgyApp{ 12 | 13 | var buildCreated : String? 14 | 15 | var buildIcon : String? 16 | 17 | var iconURL:URL?{ 18 | if let buildIcon = buildIcon { 19 | return URL(string: "https://www.pgyer.com/image/view/app_icons/\(buildIcon)") 20 | }else{ 21 | return nil 22 | } 23 | } 24 | 25 | var buildIdentifier : String? 26 | 27 | var buildName : String? 28 | 29 | var buildShortcutUrl : String? 30 | 31 | var shortURL:String?{ 32 | if let buildShortcutUrl = buildShortcutUrl { 33 | return "https://www.pgyer.com/\(buildShortcutUrl)" 34 | }else{ 35 | return nil 36 | } 37 | } 38 | 39 | 40 | var buildType : String? 41 | 42 | var type:String?{ 43 | 44 | if let buildType = buildType { 45 | 46 | if buildType == "1"{ 47 | return "iOS" 48 | }else if buildType == "2"{ 49 | return "Android" 50 | }else { 51 | return nil 52 | } 53 | 54 | }else{ 55 | return nil 56 | } 57 | 58 | } 59 | 60 | 61 | var buildVersion : String? 62 | 63 | var buildVersionNo : String? 64 | 65 | 66 | init(fromDictionary dictionary: [String:Any]){ 67 | 68 | buildCreated = dictionary["buildCreated"] as? String 69 | 70 | buildIcon = dictionary["buildIcon"] as? String 71 | 72 | buildIdentifier = dictionary["buildIdentifier"] as? String 73 | 74 | buildName = dictionary["buildName"] as? String 75 | 76 | buildShortcutUrl = dictionary["buildShortcutUrl"] as? String 77 | 78 | buildType = dictionary["buildType"] as? String 79 | 80 | buildVersion = dictionary["buildVersion"] as? String 81 | 82 | buildVersionNo = dictionary["buildVersionNo"] as? String 83 | 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /uploadIPA/Login/ViewModel/FirAppVM.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirAppVM.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class FirAppVM: NSObject { 12 | 13 | let baseURL = "http://api.fir.im/apps" 14 | 15 | lazy var firApps = [FirApp]() 16 | 17 | //获取APP列表 18 | func getApps(apiToken:String,completion:@escaping (()->())) { 19 | 20 | let params = ["api_token":apiToken] 21 | 22 | HttpTool.shared.request(method: .get, URLString: baseURL, parameters: params) { (result) in 23 | 24 | guard let _ = result["apps_count"] as? NSInteger else{ 25 | 26 | let alert = NSAlert() 27 | 28 | alert.informativeText = "请输入正确的API Token" 29 | 30 | alert.runModal() 31 | 32 | return 33 | } 34 | 35 | 36 | guard let items = result["items"] as? [[String:AnyObject]] else{ 37 | 38 | self.firApps = [] 39 | 40 | completion() 41 | 42 | return 43 | } 44 | 45 | self.firApps.removeAll() 46 | 47 | for item in items { 48 | 49 | let model = FirApp.init(fromDictionary: item) 50 | 51 | self.firApps.append(model) 52 | 53 | } 54 | 55 | completion() 56 | 57 | } 58 | 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /uploadIPA/Login/ViewModel/FirAppVM.temp_caseinsensitive_rename.swift: -------------------------------------------------------------------------------- 1 | // 2 | // firAppVM.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class FirAppVM: NSObject { 12 | 13 | let baseURL = "http://api.fir.im/apps" 14 | 15 | lazy var firApps = [FirAppModel]() 16 | 17 | //获取APP列表 18 | func getApps(apiToken:String,completion:@escaping (()->())) { 19 | 20 | let params = ["api_token":apiToken] 21 | 22 | HttpTool.shared.request(method: .get, URLString: baseURL, parameters: params) { (result) in 23 | 24 | guard let _ = result["apps_count"] as? NSInteger else{ 25 | 26 | let alert = NSAlert() 27 | 28 | alert.informativeText = "请输入正确的API Token" 29 | 30 | alert.runModal() 31 | 32 | return 33 | } 34 | 35 | 36 | guard let items = result["items"] as? [[String:AnyObject]] else{ 37 | 38 | self.firApps = [] 39 | 40 | completion() 41 | 42 | return 43 | } 44 | 45 | self.firApps.removeAll() 46 | 47 | for item in items { 48 | 49 | let model = FirAppModel.init(fromDictionary: item) 50 | 51 | self.firApps.append(model) 52 | 53 | } 54 | 55 | completion() 56 | 57 | } 58 | 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /uploadIPA/Login/ViewModel/PgyAppVM.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PgyAppVM.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class PgyAppVM: NSObject { 12 | 13 | let baseURL = "https://www.pgyer.com/apiv2/app/listMy" 14 | 15 | lazy var pgyApps = [PgyApp]() 16 | 17 | //获取APP列表 18 | func getApps(apiKey:String,completion:@escaping (()->())) { 19 | 20 | let params = ["_api_key":apiKey] 21 | 22 | HttpTool.shared.request(method: .post, URLString: baseURL, parameters: params) { (result) in 23 | 24 | guard let data = result["data"] as? [String:AnyObject] else{ 25 | 26 | let alert = NSAlert() 27 | 28 | alert.informativeText = "请输入正确的API Key" 29 | 30 | alert.runModal() 31 | 32 | return 33 | } 34 | 35 | guard let list = data["list"] as? [[String:AnyObject]] else{ 36 | 37 | self.pgyApps = [] 38 | 39 | completion() 40 | 41 | return 42 | } 43 | 44 | self.pgyApps.removeAll() 45 | 46 | for item in list { 47 | 48 | let model = PgyApp.init(fromDictionary: item) 49 | 50 | self.pgyApps.append(model) 51 | 52 | } 53 | 54 | completion() 55 | 56 | } 57 | 58 | 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /uploadIPA/Main/Controller/LeftVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LeftVC.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/30. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class LeftVC: NSViewController { 12 | 13 | @IBOutlet weak var logoView: NSImageView! 14 | 15 | @IBOutlet weak var tableView: NSTableView! 16 | 17 | var uploadType = UploadType.pgy{ 18 | didSet{ 19 | switch uploadType { 20 | case .pgy: 21 | logoView.image = #imageLiteral(resourceName: "pgy") 22 | case .fir: 23 | logoView.image = #imageLiteral(resourceName: "airplane") 24 | } 25 | } 26 | } 27 | 28 | 29 | var apps = [AnyObject](){ 30 | 31 | didSet{ 32 | 33 | tableView.reloadData() 34 | 35 | tableView.selectRowIndexes([0], byExtendingSelection: false) 36 | 37 | postNotification() 38 | 39 | } 40 | } 41 | 42 | 43 | override func viewDidLoad() { 44 | 45 | super.viewDidLoad() 46 | 47 | tableView.rowHeight = 70 48 | 49 | } 50 | 51 | 52 | } 53 | 54 | 55 | 56 | // MARK: - NSTableViewDelegate,NSTableViewDataSource 57 | extension LeftVC:NSTableViewDelegate,NSTableViewDataSource{ 58 | 59 | func numberOfRows(in tableView: NSTableView) -> Int { 60 | return apps.count 61 | } 62 | 63 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { 64 | 65 | let app = apps[row] 66 | 67 | let identifier = tableColumn?.identifier 68 | 69 | let cellView = tableView.makeView(withIdentifier: identifier!, owner: self) as? AppTableCellView 70 | 71 | cellView?.config(app, uploadType) 72 | 73 | return cellView 74 | } 75 | 76 | func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? { 77 | 78 | var rowView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "rowView"), owner: self) as? CustomTableRowView 79 | 80 | if rowView == nil { 81 | 82 | rowView = CustomTableRowView() 83 | 84 | rowView?.identifier = NSUserInterfaceItemIdentifier(rawValue: "rowView") 85 | 86 | } 87 | 88 | return rowView 89 | 90 | 91 | 92 | } 93 | 94 | 95 | func tableViewSelectionDidChange(_ notification: Notification) { 96 | 97 | postNotification() 98 | 99 | } 100 | 101 | 102 | } 103 | 104 | 105 | 106 | 107 | // MARK: - CustomMethod 108 | extension LeftVC{ 109 | 110 | func postNotification() { 111 | 112 | if tableView.selectedRow >= 0 { 113 | 114 | let app = apps[tableView.selectedRow] 115 | 116 | NotificationCenter.default.post(name: SelectionChange, object: app) 117 | 118 | } 119 | 120 | } 121 | 122 | 123 | func uploadFile(_ url:URL) { 124 | 125 | 126 | 127 | 128 | } 129 | 130 | 131 | 132 | } 133 | 134 | 135 | 136 | 137 | // MARK: - Click 138 | extension LeftVC{ 139 | 140 | @IBAction func uploadBtnClick(_ sender: Any) { 141 | 142 | let openPanel = NSOpenPanel() 143 | 144 | openPanel.allowsMultipleSelection = false 145 | 146 | openPanel.allowedFileTypes = ["ipa"] 147 | 148 | if openPanel.runModal() == NSApplication.ModalResponse.OK { 149 | 150 | guard let url = openPanel.url else{ 151 | return 152 | } 153 | 154 | uploadFile(url) 155 | 156 | } 157 | 158 | 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /uploadIPA/Main/Controller/RightVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RightVC.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/31. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class RightVC: NSViewController { 12 | 13 | @IBOutlet weak var QRCodeView: NSImageView! 14 | 15 | @IBOutlet weak var typeLbl: NSTextField! 16 | 17 | @IBOutlet weak var versionLbl: NSTextField! 18 | 19 | @IBOutlet weak var buildLbl: NSTextField! 20 | 21 | @IBOutlet weak var urlLbl: NSTextField! 22 | 23 | @IBOutlet weak var createdAtLbl: NSTextField! 24 | 25 | @IBOutlet weak var appInfoBox: NSBox! 26 | 27 | lazy var uploadType = UploadType.pgy 28 | 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | 32 | NotificationCenter.default.addObserver(forName: SelectionChange, object: nil, queue: nil) { (noti) in 33 | 34 | switch self.uploadType{ 35 | 36 | case .pgy: 37 | 38 | 39 | guard let app = noti.object as? PgyApp else { 40 | return 41 | } 42 | 43 | self.QRCodeView.image = NSImage.generateQRCode(app.shortURL ?? "", self.QRCodeView.frame.width) 44 | 45 | self.typeLbl.stringValue = app.type ?? "" 46 | 47 | self.versionLbl.stringValue = app.buildVersion ?? "" 48 | 49 | self.buildLbl.stringValue = app.buildVersionNo ?? "" 50 | 51 | self.urlLbl.stringValue = app.shortURL ?? "" 52 | 53 | self.createdAtLbl.stringValue = app.buildCreated ?? "" 54 | 55 | 56 | case .fir: 57 | 58 | guard let app = noti.object as? FirApp else { 59 | return 60 | } 61 | 62 | self.QRCodeView.image = NSImage.generateQRCode(app.shortURL ?? "", self.QRCodeView.frame.width) 63 | 64 | self.typeLbl.stringValue = app.type ?? "" 65 | 66 | self.versionLbl.stringValue = app.masterRelease?.version ?? "" 67 | 68 | self.buildLbl.stringValue = app.masterRelease?.build ?? "" 69 | 70 | self.urlLbl.stringValue = app.shortURL ?? "" 71 | 72 | if let date = app.masterRelease?.createdAt { 73 | let dateformatter = DateFormatter() 74 | dateformatter.dateStyle = .short 75 | dateformatter.timeStyle = .short 76 | self.createdAtLbl.stringValue = dateformatter.string(from: date) 77 | } 78 | 79 | } 80 | 81 | 82 | } 83 | 84 | } 85 | 86 | 87 | 88 | @IBAction func linkBtnClick(_ sender: Any) { 89 | 90 | NSWorkspace.shared.open(URL(string: urlLbl.stringValue)!) 91 | 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /uploadIPA/Main/Controller/UploadVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UploadVC.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/11/1. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class UploadVC: NSViewController { 12 | 13 | @IBOutlet weak var parsingView: NSView! 14 | 15 | @IBOutlet weak var infoView: NSView! 16 | 17 | @IBOutlet weak var appNameLabel: NSTextField! 18 | 19 | @IBOutlet weak var appIconImageView: NSImageView! 20 | 21 | @IBOutlet weak var parsingIndicator: NSProgressIndicator! 22 | 23 | @IBOutlet weak var uploadingProgressIndicator: NSProgressIndicator! 24 | 25 | @IBOutlet weak var cancelButton: NSButton! 26 | 27 | @IBOutlet weak var resultStatusView: NSView! 28 | 29 | @IBOutlet weak var resultStatusLabel: NSTextFieldCell! 30 | 31 | @IBOutlet weak var resultStatusImageView: NSImageView! 32 | 33 | var cancelActionCallback: (()->Void)? 34 | 35 | var appInfo: ParsedAppModel? { 36 | didSet{ 37 | appNameLabel.stringValue = "" 38 | 39 | if let appName = appInfo?.name { 40 | appNameLabel.stringValue = appNameLabel.stringValue + appName 41 | } 42 | if let version = appInfo?.version { 43 | appNameLabel.stringValue = appNameLabel.stringValue + " \(version)" 44 | } 45 | if let build = appInfo?.build { 46 | appNameLabel.stringValue = appNameLabel.stringValue + " Build(\(build))" 47 | } 48 | 49 | appIconImageView.image = appInfo?.icon 50 | } 51 | } 52 | 53 | override func viewDidLoad() { 54 | super.viewDidLoad() 55 | } 56 | 57 | func startParsing() { 58 | infoView.isHidden = true 59 | parsingView.isHidden = false 60 | parsingIndicator.startAnimation(self) 61 | } 62 | 63 | func stopParsing() { 64 | parsingIndicator.stopAnimation(self) 65 | self.parsingView.isHidden = true 66 | } 67 | 68 | func startUpload() { 69 | parsingView.isHidden = true 70 | infoView.isHidden = false 71 | } 72 | 73 | func stopUpload() { 74 | parsingView.isHidden = true 75 | infoView.isHidden = true 76 | } 77 | 78 | func showResultStatus(success: Bool, message: String? = nil) { 79 | self.resultStatusView.isHidden = false 80 | self.resultStatusImageView.image = NSImage(named: (success ? "success" : "error")) 81 | 82 | if let message = message { 83 | self.resultStatusLabel.stringValue = message; 84 | }else{ 85 | self.resultStatusLabel.stringValue = (success ? "上传成功!" : "上传失败!") 86 | } 87 | 88 | cancelButton.title = success ? "完成" : "取消"; 89 | } 90 | 91 | @IBAction func cancelAction(_ sender: NSButton) { 92 | cancelActionCallback?() 93 | self.dismiss(nil) 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /uploadIPA/Main/Model/ParsedAppModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ParsedAppModel.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/11/1. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | struct ParsedAppModel { 12 | 13 | var name:String? 14 | 15 | var bundleID:String? 16 | 17 | var version:String? 18 | 19 | var build:String? 20 | 21 | var icon:NSImage? 22 | 23 | var sourceFileURL:URL? 24 | 25 | } 26 | -------------------------------------------------------------------------------- /uploadIPA/Main/View/AppTableCellView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppTableCellView.swift 3 | // IPADownload 4 | // 5 | // Created by Jason on 2018/10/24. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SDWebImage 11 | 12 | class AppTableCellView: NSTableCellView { 13 | 14 | @IBOutlet weak var iconView: NSImageView! 15 | 16 | @IBOutlet weak var nameLbl: NSTextField! 17 | 18 | @IBOutlet weak var bundleIDLbl: NSTextField! 19 | 20 | 21 | func config(_ model:AnyObject,_ type:UploadType) { 22 | 23 | iconView.wantsLayer = true 24 | 25 | iconView.layer?.cornerRadius = 4.0 26 | 27 | switch type { 28 | case .pgy: 29 | 30 | guard let model = model as? PgyApp else { 31 | return 32 | } 33 | 34 | nameLbl.stringValue = model.buildName ?? "" 35 | 36 | bundleIDLbl.stringValue = model.buildIdentifier ?? "" 37 | 38 | iconView.sd_setImage(with: model.iconURL) 39 | 40 | case .fir: 41 | 42 | guard let model = model as? FirApp else { 43 | return 44 | } 45 | 46 | nameLbl.stringValue = model.name ?? "" 47 | 48 | bundleIDLbl.stringValue = model.bundleID ?? "" 49 | 50 | iconView.sd_setImage(with: model.iconURL) 51 | 52 | } 53 | 54 | } 55 | 56 | 57 | override func draw(_ dirtyRect: NSRect) { 58 | super.draw(dirtyRect) 59 | 60 | // Drawing code here. 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /uploadIPA/Main/View/CustomTableRowView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTableView.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/10/31. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class CustomTableRowView: NSTableRowView { 12 | 13 | override func drawSelection(in dirtyRect: NSRect) { 14 | 15 | super.drawSelection(in: dirtyRect) 16 | 17 | if selectionHighlightStyle != .none { 18 | 19 | let selectionRect = bounds 20 | 21 | NSColor.white.setStroke() //设置边框颜色 22 | 23 | NSColor(red: 0.96, green: 0.97, blue: 0.98, alpha: 1).setFill() //设置填充背景颜色 24 | 25 | let path = NSBezierPath(rect: selectionRect) 26 | 27 | path.fill() 28 | 29 | path.stroke() 30 | 31 | } 32 | } 33 | 34 | 35 | //点击cell呈现自定义图片的方法 36 | // override func drawSelection(in dirtyRect: NSRect) { 37 | // 38 | // super.drawSelection(in: dirtyRect) 39 | // 40 | // if selectionHighlightStyle != .none { 41 | // 42 | // let image = NSImage(named: "选中") 43 | // 44 | // let imageRep = image?.representations.first 45 | // 46 | // let fromRect = NSRect(x: 0, y: 0, width: imageRep?.size.width ?? 0, height: imageRep?.size.height ?? 0) 47 | // 48 | // imageRep?.draw(in: dirtyRect, from: fromRect, operation: .sourceOver, fraction: 1.0, respectFlipped: true, hints: nil) 49 | // 50 | // } 51 | // 52 | // } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /uploadIPA/Tools/HttpTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HttpTool.swift 3 | // IPADownload 4 | // 5 | // Created by Jason on 2018/10/24. 6 | // Copyright © 2018年 Jason. All rights reserved. 7 | // 8 | 9 | import Alamofire 10 | 11 | //设置manager属性 (重要) 12 | var manager:SessionManager? = nil 13 | 14 | 15 | class HttpTool: NSObject { 16 | 17 | /// 创建单例 18 | static let shared:HttpTool = { 19 | 20 | let instance = HttpTool() 21 | 22 | //配置 , 通常默认即可 23 | let config:URLSessionConfiguration = URLSessionConfiguration.default 24 | 25 | //设置超时时间为60S 26 | config.timeoutIntervalForRequest = 60 27 | config.requestCachePolicy = .reloadIgnoringCacheData 28 | 29 | //根据config创建manager 30 | manager = SessionManager(configuration: config) 31 | 32 | manager?.delegate.sessionDidReceiveChallenge = { session, challenge in 33 | var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling 34 | var credential: URLCredential? 35 | 36 | if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { 37 | disposition = URLSession.AuthChallengeDisposition.useCredential 38 | credential = URLCredential(trust: challenge.protectionSpace.serverTrust!) 39 | } else { 40 | if challenge.previousFailureCount > 0 { 41 | disposition = .cancelAuthenticationChallenge 42 | } else { 43 | credential = manager?.session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) 44 | 45 | if credential != nil { 46 | disposition = .useCredential 47 | } 48 | } 49 | } 50 | return (disposition, credential) 51 | } 52 | 53 | return instance 54 | }() 55 | 56 | } 57 | 58 | 59 | // MARK: - 网络请求 60 | extension HttpTool{ 61 | 62 | 63 | func request(method:Alamofire.HTTPMethod, URLString:String, parameters:[String:Any]?, completion:@escaping (_ value:AnyObject)->()) { 64 | 65 | var params = parameters 66 | 67 | if params == nil { 68 | params = [String:Any]() 69 | } 70 | 71 | manager?.request(URLString, method: method, parameters: params).responseJSON(completionHandler:{(response) in 72 | 73 | switch response.result.isSuccess{ 74 | case true: 75 | 76 | let obj = response.result.value as AnyObject 77 | 78 | completion(obj) 79 | 80 | case false: break 81 | 82 | } 83 | 84 | }) 85 | } 86 | 87 | 88 | func download(URLString:String,title:String,progressHandler:@escaping ((_ progress:Double)->()),completion:@escaping (()->())) { 89 | 90 | let destination: DownloadRequest.DownloadFileDestination = { _, _ in 91 | let downloadURL = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask)[0] 92 | let fileURL = downloadURL.appendingPathComponent("\(title).ipa") 93 | 94 | return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) 95 | } 96 | 97 | manager?.download(URLString, to: destination).downloadProgress(closure: { (progress) in 98 | 99 | let value = Double(progress.completedUnitCount)/Double(progress.totalUnitCount) 100 | 101 | progressHandler(value) 102 | 103 | }).responseData(completionHandler: { (response) in 104 | 105 | switch response.result { 106 | 107 | case .success: 108 | 109 | print("文件下载完毕: \(response)") 110 | 111 | case .failure: 112 | 113 | 114 | break 115 | } 116 | 117 | completion() 118 | 119 | }) 120 | 121 | 122 | 123 | } 124 | 125 | } 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /uploadIPA/Tools/Shell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Shell.swift 3 | // uploadIPA 4 | // 5 | // Created by Jason on 2018/11/5. 6 | // Copyright © 2018 Jason. All rights reserved. 7 | // 用来执行cmd 指令的模块 8 | 9 | import Foundation 10 | 11 | struct Shell { 12 | /* 用于执行指令操作的封装 13 | * cmd : 需要执行的命令 14 | * arguments : 执行命令的参数 15 | * return : 命令执行后的结果字符串 16 | */ 17 | static func execmd(_ cmd: String, arguments:[String]) -> String { 18 | 19 | let task = Process() 20 | 21 | // 1. 设置命令的参数 22 | task.arguments = arguments 23 | // 2. 设置执行命令 24 | task.launchPath = cmd 25 | 26 | // 3. 设置命令执行后的接收管道 27 | let output = Pipe() 28 | task.standardOutput = output 29 | 30 | // 开始执行 31 | task.launch() 32 | // 等待直到执行结束 33 | task.waitUntilExit() 34 | // 在命令结束后,获取结果 35 | let data = output.fileHandleForReading.readDataToEndOfFile() 36 | 37 | let resut = String(data: data, encoding: .utf8) 38 | 39 | return resut ?? "" 40 | } 41 | 42 | } 43 | --------------------------------------------------------------------------------