├── Carthage
└── Build
│ ├── Mac
│ ├── Alamofire.framework
│ │ ├── Versions
│ │ │ ├── Current
│ │ │ └── A
│ │ │ │ ├── Alamofire
│ │ │ │ ├── Modules
│ │ │ │ ├── Alamofire.swiftmodule
│ │ │ │ │ ├── x86_64.swiftdoc
│ │ │ │ │ └── x86_64.swiftmodule
│ │ │ │ └── module.modulemap
│ │ │ │ ├── Headers
│ │ │ │ └── Alamofire.h
│ │ │ │ └── Resources
│ │ │ │ └── Info.plist
│ │ ├── Headers
│ │ ├── Modules
│ │ ├── Alamofire
│ │ └── Resources
│ └── SDWebImage.framework
│ │ ├── Versions
│ │ ├── Current
│ │ └── A
│ │ │ ├── SDWebImage
│ │ │ ├── Modules
│ │ │ └── module.modulemap
│ │ │ ├── PrivateHeaders
│ │ │ ├── SDImageGIFCoderInternal.h
│ │ │ ├── SDImageAPNGCoderInternal.h
│ │ │ ├── UIColor+HexString.h
│ │ │ ├── SDWeakProxy.h
│ │ │ ├── SDAsyncBlockOperation.h
│ │ │ ├── SDImageCachesManagerOperation.h
│ │ │ ├── NSBezierPath+RoundedCorners.h
│ │ │ ├── SDImageAssetManager.h
│ │ │ └── SDInternalMacros.h
│ │ │ ├── Headers
│ │ │ ├── SDWebImageOperation.h
│ │ │ ├── SDImageAPNGCoder.h
│ │ │ ├── UIImage+GIF.h
│ │ │ ├── SDAnimatedImageRep.h
│ │ │ ├── SDImageGIFCoder.h
│ │ │ ├── SDWebImageCacheKeyFilter.h
│ │ │ ├── SDImageLoadersManager.h
│ │ │ ├── SDImageFrame.h
│ │ │ ├── SDWebImageCacheSerializer.h
│ │ │ ├── SDWebImageDownloaderRequestModifier.h
│ │ │ ├── SDImageIOCoder.h
│ │ │ ├── UIImage+MemoryCacheCost.h
│ │ │ ├── SDWebImageError.h
│ │ │ ├── SDImageGraphics.h
│ │ │ ├── UIImage+ForceDecode.h
│ │ │ ├── UIView+WebCacheOperation.h
│ │ │ ├── NSData+ImageContentType.h
│ │ │ ├── UIImage+Metadata.h
│ │ │ ├── SDImageCodersManager.h
│ │ │ ├── SDWebImageCompat.h
│ │ │ ├── NSImage+Compatibility.h
│ │ │ ├── SDMemoryCache.h
│ │ │ ├── SDImageCachesManager.h
│ │ │ ├── SDWebImage.h
│ │ │ ├── UIImage+MultiFormat.h
│ │ │ ├── SDWebImageIndicator.h
│ │ │ ├── SDAnimatedImageView.h
│ │ │ ├── SDWebImageDownloaderConfig.h
│ │ │ ├── SDWebImageTransition.h
│ │ │ ├── SDDiskCache.h
│ │ │ ├── SDImageCoderHelper.h
│ │ │ ├── UIView+WebCache.h
│ │ │ ├── SDImageCacheConfig.h
│ │ │ ├── UIImage+Transform.h
│ │ │ ├── SDAnimatedImage.h
│ │ │ ├── SDImageCacheDefine.h
│ │ │ ├── SDWebImagePrefetcher.h
│ │ │ ├── SDWebImageDownloaderOperation.h
│ │ │ ├── UIImageView+HighlightedWebCache.h
│ │ │ ├── SDImageLoader.h
│ │ │ ├── SDImageTransformer.h
│ │ │ ├── SDAnimatedImageView+WebCache.h
│ │ │ ├── UIImageView+WebCache.h
│ │ │ ├── SDImageCoder.h
│ │ │ └── SDWebImageManager.h
│ │ │ └── Resources
│ │ │ └── Info.plist
│ │ ├── Headers
│ │ ├── Modules
│ │ ├── Resources
│ │ ├── SDWebImage
│ │ └── PrivateHeaders
│ ├── .Alamofire.version
│ └── .SDWebImage.version
├── Assets
└── screenshot.gif
├── IPADownload
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ ├── icon_16x16.png
│ │ ├── icon_32x32.png
│ │ ├── icon_128x128.png
│ │ ├── icon_16x16@2x.png
│ │ ├── icon_256x256.png
│ │ ├── icon_32x32@2x.png
│ │ ├── icon_512x512.png
│ │ ├── icon_128x128@2x.png
│ │ ├── icon_256x256@2x.png
│ │ ├── icon_512x512@2x.png
│ │ └── Contents.json
├── Common
│ └── Common.swift
├── AppDelegate.swift
├── Main
│ ├── Model
│ │ └── APPModel.swift
│ ├── ViewModel
│ │ └── APPVM.swift
│ ├── View
│ │ └── resultCellView.swift
│ └── MainVC.swift
├── Info.plist
└── Tools
│ └── HttpTool.swift
├── IPADownload.xcodeproj
├── xcuserdata
│ ├── jason.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── mac.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ ├── mac.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ │ └── jason.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ └── IPADownload.xcscheme
└── README.md
/Carthage/Build/Mac/Alamofire.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Modules:
--------------------------------------------------------------------------------
1 | Versions/Current/Modules
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Modules:
--------------------------------------------------------------------------------
1 | Versions/Current/Modules
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Alamofire:
--------------------------------------------------------------------------------
1 | Versions/Current/Alamofire
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Resources:
--------------------------------------------------------------------------------
1 | Versions/Current/Resources
--------------------------------------------------------------------------------
/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/PrivateHeaders:
--------------------------------------------------------------------------------
1 | Versions/Current/PrivateHeaders
--------------------------------------------------------------------------------
/Assets/screenshot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/Assets/screenshot.gif
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/SDWebImage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/Carthage/Build/Mac/SDWebImage.framework/Versions/A/SDWebImage
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_16x16.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_32x32.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_128x128.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_256x256.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_512x512.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/xcuserdata/jason.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/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/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenjie1219/IPADownload/HEAD/IPADownload.xcodeproj/project.xcworkspace/xcuserdata/jason.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/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/.Alamofire.version:
--------------------------------------------------------------------------------
1 | {
2 | "commitish" : "4.8.2",
3 | "Mac" : [
4 | {
5 | "name" : "Alamofire",
6 | "hash" : "d0e9d7d9fe6fcab23925d3c0da6c493154e83b963da3f02c13c70a29ac9a03dc",
7 | "swiftToolchainVersion" : "5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)"
8 | }
9 | ]
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IPADownload
2 |  
3 |
4 | 这是一个搜索并下载 [PP 助手](http://www.25pp.com/)应用市场里的 IPA 文件的工具。
5 |
6 | **所下载的文件仅供逆向工程研究使用**。
7 |
8 | 
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Carthage/Build/.SDWebImage.version:
--------------------------------------------------------------------------------
1 | {
2 | "commitish" : "5.0.6",
3 | "Mac" : [
4 | {
5 | "name" : "SDWebImageMapKit",
6 | "hash" : "214bc440c6c0145b94fe92925f4c264cee702dc780e949c82134c5c01d4a9eca"
7 | },
8 | {
9 | "name" : "SDWebImage",
10 | "hash" : "85c3f4f910cb7be145dcad34f5243b8f706aba3158fbf6c3f0c99238840a6347"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/IPADownload/Common/Common.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Common.swift
3 | // IPADownload
4 | //
5 | // Created by Jason on 2018/10/23.
6 | // Copyright © 2018 Jason. All rights reserved.
7 | //
8 |
9 |
10 | enum PPSearchType {
11 | case PPJailbreak
12 | case PPStore
13 | }
14 |
15 | let baseURL = "https://jsondata.25pp.com/index.html"
16 |
17 | let PPJailbreakCommand = "4262469664"
18 |
19 | let PPStoreCommand = "4262469686"
20 |
21 |
22 |
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/xcuserdata/jason.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | IPADownload.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDImageGIFCoderInternal.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 "SDImageGIFCoder.h"
11 |
12 | @interface SDImageGIFCoder ()
13 |
14 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDImageAPNGCoderInternal.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 "SDImageAPNGCoder.h"
11 |
12 | @interface SDImageAPNGCoder ()
13 |
14 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source;
15 | - (NSUInteger)sd_imageLoopCountWithSource:(nonnull CGImageSourceRef)source;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/UIColor+HexString.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 UIColor (HexString)
12 |
13 | /**
14 | Convenience way to get hex string from color. The output should always be 32-bit RGBA hex string like `#00000000`.
15 | */
16 | @property (nonatomic, copy, readonly, nonnull) NSString *sd_hexString;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/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 | /// A protocol represents cancelable operation.
12 | @protocol SDWebImageOperation
13 |
14 | - (void)cancel;
15 |
16 | @end
17 |
18 | /// NSOperation conform to `SDWebImageOperation`.
19 | @interface NSOperation (SDWebImageOperation)
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDWeakProxy.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 SDWeakProxy : NSProxy
13 |
14 | @property (nonatomic, weak, readonly, nullable) id target;
15 |
16 | - (nonnull instancetype)initWithTarget:(nonnull id)target;
17 | + (nonnull instancetype)proxyWithTarget:(nonnull id)target;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | IPADownload.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 9668E3932180087F005EC44C
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageAPNGCoder.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 "SDImageCoder.h"
11 |
12 | /**
13 | Built in coder using ImageIO that supports APNG encoding/decoding
14 | */
15 | @interface SDImageAPNGCoder : NSObject
16 |
17 | @property (nonatomic, class, readonly, nonnull) SDImageAPNGCoder *sharedCoder;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDAsyncBlockOperation.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 | @class SDAsyncBlockOperation;
12 | typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation);
13 |
14 | @interface SDAsyncBlockOperation : NSOperation
15 |
16 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block;
17 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block;
18 | - (void)complete;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDImageCachesManagerOperation.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 | // This is used for operation management, but not for operation queue execute
13 | @interface SDImageCachesManagerOperation : NSOperation
14 |
15 | @property (nonatomic, assign, readonly) NSUInteger pendingCount;
16 |
17 | - (void)beginWithTotalCount:(NSUInteger)totalCount;
18 | - (void)completeOne;
19 | - (void)done;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/IPADownload/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // IPADownload
4 | //
5 | // Created by Jason on 2018/10/23.
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 |
21 | func applicationWillTerminate(_ aNotification: Notification) {
22 | // Insert code here to tear down your application
23 | }
24 |
25 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
26 | return true
27 | }
28 |
29 |
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/NSBezierPath+RoundedCorners.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 "UIImage+Transform.h"
14 |
15 | @interface NSBezierPath (RoundedCorners)
16 |
17 | /**
18 | Convenience way to create a bezier path with the specify rounding corners on macOS. Same as the one on `UIBezierPath`.
19 | */
20 | + (nonnull instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius;
21 |
22 | @end
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/IPADownload/Main/Model/APPModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // APPModel.swift
3 | // IPADownload
4 | //
5 | // Created by Jason on 2018/10/23.
6 | // Copyright © 2018 Jason. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | struct APPModel {
12 |
13 | var title:String?
14 |
15 | var desc:String?
16 |
17 | var version:String?
18 |
19 | var fsize:String?
20 |
21 | var thumb:String?
22 |
23 | var downurl:String?
24 |
25 |
26 | init(fromDictionary dictionary: [String:Any]){
27 | title = dictionary["title"] as? String
28 | desc = dictionary["desc"] as? String
29 | version = dictionary["version"] as? String
30 | fsize = dictionary["fsize"] as? String
31 | thumb = dictionary["thumb"] as? String
32 | downurl = dictionary["downurl"] as? String
33 | }
34 |
35 | }
36 |
37 |
38 |
--------------------------------------------------------------------------------
/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 | /**
13 | This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`.
14 | */
15 | @interface UIImage (GIF)
16 |
17 | /**
18 | Creates an animated UIImage from an NSData.
19 | This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF.
20 |
21 | @param data The GIF data
22 | @return The created image
23 | */
24 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/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 | /**
14 | A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`.
15 | Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image.
16 | This also support APNG format using `SDImageAPNGCoder`. Which provide full alpha-channel support and the correct duration match the `kCGImagePropertyAPNGUnclampedDelayTime`.
17 | */
18 | @interface SDAnimatedImageRep : NSBitmapImageRep
19 |
20 | @end
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDImageAssetManager.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 | // Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :)
13 |
14 | @interface SDImageAssetManager : NSObject
15 |
16 | @property (nonatomic, strong, nonnull) NSMapTable *imageTable;
17 |
18 | + (nonnull instancetype)sharedAssetManager;
19 | - (nullable NSString *)getPathForName:(nonnull NSString *)name bundle:(nonnull NSBundle *)bundle preferredScale:(nonnull CGFloat *)scale;
20 | - (nullable UIImage *)imageForName:(nonnull NSString *)name;
21 | - (void)storeImage:(nonnull UIImage *)image forName:(nonnull NSString *)name;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageGIFCoder.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 "SDImageCoder.h"
11 |
12 | /**
13 | Built in coder using ImageIO that supports animated GIF encoding/decoding
14 | @note `SDImageIOCoder` supports GIF but only as static (will use the 1st frame).
15 | @note Use `SDImageGIFCoder` for fully animated GIFs. For `UIImageView`, it will produce animated `UIImage`(`NSImage` on macOS) for rendering. For `SDAnimatedImageView`, it will use `SDAnimatedImage` for rendering.
16 | @note The recommended approach for animated GIFs is using `SDAnimatedImage` with `SDAnimatedImageView`. It's more performant than `UIImageView` for GIF displaying(especially on memory usage)
17 | */
18 | @interface SDImageGIFCoder : NSObject
19 |
20 | @property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCacheKeyFilter.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 NSString * _Nullable(^SDWebImageCacheKeyFilterBlock)(NSURL * _Nonnull url);
13 |
14 | /**
15 | This is the protocol for cache key filter.
16 | We can use a block to specify the cache key filter. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options.
17 | */
18 | @protocol SDWebImageCacheKeyFilter
19 |
20 | - (nullable NSString *)cacheKeyForURL:(nonnull NSURL *)url;
21 |
22 | @end
23 |
24 | /**
25 | A cache key filter class with block.
26 | */
27 | @interface SDWebImageCacheKeyFilter : NSObject
28 |
29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block;
30 | + (nonnull instancetype)cacheKeyFilterWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/IPADownload/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 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageLoadersManager.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 "SDImageLoader.h"
10 |
11 | /**
12 | A loaders manager to manage multiple loaders
13 | */
14 | @interface SDImageLoadersManager : NSObject
15 |
16 | /**
17 | Returns the global shared loaders manager instance. By default we will set [`SDWebImageDownloader.sharedDownloader`] into the loaders array.
18 | */
19 | @property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager;
20 |
21 | /**
22 | All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority
23 | */
24 | @property (nonatomic, copy, nullable) NSArray>* loaders;
25 |
26 | /**
27 | Add a new image loader to the end of loaders array. Which has the highest priority.
28 |
29 | @param loader loader
30 | */
31 | - (void)addLoader:(nonnull id)loader;
32 |
33 | /**
34 | Remove a image loader in the loaders array.
35 |
36 | @param loader loader
37 | */
38 | - (void)removeLoader:(nonnull id)loader;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageFrame.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 | /**
13 | This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`.
14 | @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`.
15 | */
16 | @interface SDImageFrame : NSObject
17 |
18 | /**
19 | The image of current frame. You should not set an animated image.
20 | */
21 | @property (nonatomic, strong, readonly, nonnull) UIImage *image;
22 | /**
23 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.
24 | */
25 | @property (nonatomic, readonly, assign) NSTimeInterval duration;
26 |
27 | /**
28 | Create a frame instance with specify image and duration
29 |
30 | @param image current frame's image
31 | @param duration current frame's duration
32 | @return frame instance
33 | */
34 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/IPADownload/Main/ViewModel/APPVM.swift:
--------------------------------------------------------------------------------
1 | //
2 | // APPVM.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 |
11 | class APPVM: NSObject {
12 |
13 | lazy var apps = [APPModel]()
14 |
15 | func searchApp(_ keyword:String,_ type:PPSearchType,completion:@escaping (()->())) {
16 |
17 | let tunnel = (type == .PPJailbreak) ? PPJailbreakCommand : PPStoreCommand
18 |
19 | let clFlag = (type == .PPJailbreak) ? 1 : 3
20 |
21 | let params = ["dcType":0,"keyword":keyword,"clFlag":clFlag,"perCount":30,"page":0] as [String : Any]
22 |
23 | let urlStr = baseURL+"?Tunnel-Command="+tunnel
24 |
25 | HttpTool.shared.request(method: .post, URLString: urlStr, parameters: params) { (result) in
26 |
27 | guard let content = result["content"] as? [[String:AnyObject]] else{
28 | return
29 | }
30 |
31 | for dic in content {
32 |
33 | let model = APPModel(fromDictionary: dic)
34 |
35 | self.apps.append(model)
36 |
37 | }
38 |
39 | completion()
40 |
41 | }
42 | }
43 |
44 |
45 |
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageCacheSerializer.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 NSData * _Nullable(^SDWebImageCacheSerializerBlock)(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL);
13 |
14 | /**
15 | This is the protocol for cache serializer.
16 | We can use a block to specify the cache serializer. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options.
17 | */
18 | @protocol SDWebImageCacheSerializer
19 |
20 | - (nullable NSData *)cacheDataWithImage:(nonnull UIImage *)image originalData:(nullable NSData *)data imageURL:(nullable NSURL *)imageURL;
21 |
22 | @end
23 |
24 | /**
25 | A cache serializer class with block.
26 | */
27 | @interface SDWebImageCacheSerializer : NSObject
28 |
29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheSerializerBlock)block;
30 | + (nonnull instancetype)cacheSerializerWithBlock:(nonnull SDWebImageCacheSerializerBlock)block;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageDownloaderRequestModifier.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 NSURLRequest * _Nullable (^SDWebImageDownloaderRequestModifierBlock)(NSURLRequest * _Nonnull request);
13 |
14 | /**
15 | This is the protocol for downloader request modifier.
16 | We can use a block to specify the downloader request modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options.
17 | */
18 | @protocol SDWebImageDownloaderRequestModifier
19 |
20 | - (nullable NSURLRequest *)modifiedRequestWithRequest:(nonnull NSURLRequest *)request;
21 |
22 | @end
23 |
24 | /**
25 | A downloader request modifier class with block.
26 | */
27 | @interface SDWebImageDownloaderRequestModifier : NSObject
28 |
29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block;
30 | + (nonnull instancetype)requestModifierWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block;
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageIOCoder.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 "SDImageCoder.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 `SDAnimatedImageView` to keep both CPU and memory balanced.
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 SDImageIOCoder : NSObject
27 |
28 | @property (nonatomic, class, readonly, nonnull) SDImageIOCoder *sharedCoder;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+MemoryCacheCost.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 | /**
12 | UIImage category for memory cache cost.
13 | */
14 | @interface UIImage (MemoryCacheCost)
15 |
16 | /**
17 | The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory.
18 | If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
19 |
20 | For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Retuen full frame bytes size when `image.images` is not nil for animated image.
21 | For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory.
22 | @note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods.
23 | @note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes.
24 | */
25 | @property (assign, nonatomic) NSUInteger sd_memoryCost;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h:
--------------------------------------------------------------------------------
1 | //
2 | // Alamofire.h
3 | //
4 | // Copyright (c) 2014 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/SDWebImage.framework/Versions/A/Headers/SDWebImageError.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 "SDWebImageCompat.h"
11 |
12 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull SDWebImageErrorDomain;
13 |
14 | /// The HTTP status code for invalid download response (NSNumber *)
15 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey;
16 |
17 | /// SDWebImage error domain and codes
18 | typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) {
19 | SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL
20 | SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty
21 | SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached`
22 | SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized
23 | SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image downloda response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey`
24 | };
25 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageGraphics.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
11 |
12 | /**
13 | These following graphics context method are provided to easily write cross-platform(AppKit/UIKit) code.
14 | For UIKit, these methods just call the same method in `UIGraphics.h`. See the documentation for usage.
15 | For AppKit, these methods use `NSGraphicsContext` to create image context and match the behavior like UIKit.
16 | */
17 |
18 | /// Returns the current graphics context.
19 | FOUNDATION_EXPORT CGContextRef __nullable SDGraphicsGetCurrentContext(void) CF_RETURNS_NOT_RETAINED;
20 | /// Creates a bitmap-based graphics context and makes it the current context.
21 | FOUNDATION_EXPORT void SDGraphicsBeginImageContext(CGSize size);
22 | /// Creates a bitmap-based graphics context with the specified options.
23 | FOUNDATION_EXPORT void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);
24 | /// Removes the current bitmap-based graphics context from the top of the stack.
25 | FOUNDATION_EXPORT void SDGraphicsEndImageContext(void);
26 | /// Returns an image based on the contents of the current bitmap-based graphics context.
27 | FOUNDATION_EXPORT UIImage * __nullable SDGraphicsGetImageFromCurrentImageContext(void);
28 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 19A471t
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.8.2
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 | 10E1001
33 | DTPlatformVersion
34 | GM
35 | DTSDKBuild
36 | 18E219
37 | DTSDKName
38 | macosx10.14
39 | DTXcode
40 | 1020
41 | DTXcodeBuild
42 | 10E1001
43 | UIDeviceFamily
44 |
45 | 1
46 | 2
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/IPADownload/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "icon_16x16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "icon_16x16@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "icon_32x32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "icon_32x32@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "icon_128x128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "icon_128x128@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "icon_256x256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "icon_256x256@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "icon_512x512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "icon_512x512@2x.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 19A471t
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | SDWebImage
11 | CFBundleIdentifier
12 | com.dailymotion.SDWebImage
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | SDWebImage
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 5.0.6
21 | CFBundleSignature
22 | ????
23 | CFBundleSupportedPlatforms
24 |
25 | MacOSX
26 |
27 | CFBundleVersion
28 | 5.0.6
29 | DTCompiler
30 | com.apple.compilers.llvm.clang.1_0
31 | DTPlatformBuild
32 | 10E1001
33 | DTPlatformVersion
34 | GM
35 | DTSDKBuild
36 | 18E219
37 | DTSDKName
38 | macosx10.14
39 | DTXcode
40 | 1020
41 | DTXcodeBuild
42 | 10E1001
43 | UIDeviceFamily
44 |
45 | 1
46 | 2
47 | 3
48 | 4
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/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 | /**
12 | UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior).
13 | */
14 | @interface UIImage (ForceDecode)
15 |
16 | /**
17 | A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode.
18 | */
19 | @property (nonatomic, assign) BOOL sd_isDecoded;
20 |
21 | /**
22 | Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance.
23 |
24 | @param image The image to be decoded
25 | @return The decoded image
26 | */
27 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image;
28 |
29 | /**
30 | Decode and scale down the provided image
31 |
32 | @param image The image to be decoded
33 | @return The decoded and scaled down image
34 | */
35 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
36 |
37 | /**
38 | Decode and scale down the provided image with limit bytes
39 |
40 | @param image The image to be decoded
41 | @param bytes The limit bytes size. Provide 0 to use the build-in limit.
42 | @return The decoded and scaled down image
43 | */
44 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/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 | /**
13 | These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external.
14 | 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.
15 | */
16 | @interface UIView (WebCacheOperation)
17 |
18 | /**
19 | * Get the image load operation for key
20 | *
21 | * @param key key for identifying the operations
22 | * @return the image load operation
23 | */
24 | - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key;
25 |
26 | /**
27 | * Set the image load operation (storage in a UIView based weak map table)
28 | *
29 | * @param operation the operation
30 | * @param key key for storing the operation
31 | */
32 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key;
33 |
34 | /**
35 | * Cancel all operations for the current UIView and key
36 | *
37 | * @param key key for identifying the operations
38 | */
39 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
40 |
41 | /**
42 | * Just remove the operations corresponding to the current UIView and key without cancelling them
43 | *
44 | * @param key key for identifying the operations
45 | */
46 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/PrivateHeaders/SDInternalMacros.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 "SDmetamacros.h"
11 |
12 | #ifndef SD_LOCK
13 | #define SD_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
14 | #endif
15 |
16 | #ifndef SD_UNLOCK
17 | #define SD_UNLOCK(lock) dispatch_semaphore_signal(lock);
18 | #endif
19 |
20 | #ifndef weakify
21 | #define weakify(...) \
22 | sd_keywordify \
23 | metamacro_foreach_cxt(sd_weakify_,, __weak, __VA_ARGS__)
24 | #endif
25 |
26 | #ifndef strongify
27 | #define strongify(...) \
28 | sd_keywordify \
29 | _Pragma("clang diagnostic push") \
30 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \
31 | metamacro_foreach(sd_strongify_,, __VA_ARGS__) \
32 | _Pragma("clang diagnostic pop")
33 | #endif
34 |
35 | #define sd_weakify_(INDEX, CONTEXT, VAR) \
36 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR);
37 |
38 | #define sd_strongify_(INDEX, VAR) \
39 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_);
40 |
41 | #if DEBUG
42 | #define sd_keywordify autoreleasepool {}
43 | #else
44 | #define sd_keywordify try {} @catch (...) {}
45 | #endif
46 |
47 | #ifndef onExit
48 | #define onExit \
49 | sd_keywordify \
50 | __strong sd_cleanupBlock_t metamacro_concat(sd_exitBlock_, __LINE__) __attribute__((cleanup(sd_executeCleanupBlock), unused)) = ^
51 | #endif
52 |
53 | typedef void (^sd_cleanupBlock_t)(void);
54 |
55 | #if defined(__cplusplus)
56 | extern "C" {
57 | #endif
58 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block);
59 | #if defined(__cplusplus)
60 | }
61 | #endif
62 |
--------------------------------------------------------------------------------
/IPADownload/Main/View/resultCellView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // resultCellView.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 resultCellView: NSTableCellView {
13 |
14 | @IBOutlet weak var iconView: NSImageView!
15 |
16 | @IBOutlet weak var titleLbl: NSTextField!
17 |
18 | @IBOutlet weak var versionLbl: NSTextField!
19 |
20 | @IBOutlet weak var sizeLbl: NSTextField!
21 |
22 | lazy var downloadURL = ""
23 |
24 | func config(_ model:APPModel) {
25 |
26 | titleLbl.stringValue = model.title ?? ""
27 |
28 | versionLbl.stringValue = model.version ?? ""
29 |
30 | sizeLbl.stringValue = model.fsize ?? ""
31 |
32 | let url = URL(string: model.thumb ?? "")
33 |
34 | iconView.sd_setImage(with: url)
35 |
36 | downloadURL = model.downurl ?? ""
37 |
38 | }
39 |
40 | @IBAction func downloadBtnClick(_ sender: NSButton) {
41 |
42 | sender.isEnabled = false
43 |
44 | sender.title = "下载中"
45 |
46 | HttpTool.shared.download(URLString: downloadURL, title: titleLbl.stringValue, progressHandler: { (value) in
47 |
48 |
49 |
50 | let progressStr = String(format: "%.2f", value*100)
51 |
52 | sender.title = "\(progressStr)%"
53 |
54 | }) {
55 |
56 | sender.isEnabled = true
57 |
58 | sender.title = "下载"
59 |
60 | let downloadPath = "~/Downloads"
61 |
62 | NSWorkspace.shared.selectFile("\(downloadPath)/\(self.titleLbl.stringValue).ipa", inFileViewerRootedAtPath: downloadPath)
63 |
64 | }
65 |
66 | }
67 |
68 | override func draw(_ dirtyRect: NSRect) {
69 | super.draw(dirtyRect)
70 |
71 | // Drawing code here.
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/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 | /**
14 | You can use switch case like normal enum. It's also recommended to add a default case. You should not assume anything about the raw value.
15 | For custom coder plugin, it can also extern the enum for supported format. See `SDImageCoder` for more detailed information.
16 | */
17 | typedef NSInteger SDImageFormat NS_TYPED_EXTENSIBLE_ENUM;
18 | static const SDImageFormat SDImageFormatUndefined = -1;
19 | static const SDImageFormat SDImageFormatJPEG = 0;
20 | static const SDImageFormat SDImageFormatPNG = 1;
21 | static const SDImageFormat SDImageFormatGIF = 2;
22 | static const SDImageFormat SDImageFormatTIFF = 3;
23 | static const SDImageFormat SDImageFormatWebP = 4;
24 | static const SDImageFormat SDImageFormatHEIC = 5;
25 | static const SDImageFormat SDImageFormatHEIF = 6;
26 |
27 | /**
28 | NSData category about the image content type and UTI.
29 | */
30 | @interface NSData (ImageContentType)
31 |
32 | /**
33 | * Return image format
34 | *
35 | * @param data the input image data
36 | *
37 | * @return the image format as `SDImageFormat` (enum)
38 | */
39 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data;
40 |
41 | /**
42 | * Convert SDImageFormat to UTType
43 | *
44 | * @param format Format as SDImageFormat
45 | * @return The UTType as CFStringRef
46 | */
47 | + (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED NS_SWIFT_NAME(sd_UTType(from:));
48 |
49 | /**
50 | * Convert UTTyppe to SDImageFormat
51 | *
52 | * @param uttype The UTType as CFStringRef
53 | * @return The Format as SDImageFormat
54 | */
55 | + (SDImageFormat)sd_imageFormatFromUTType:(nonnull CFStringRef)uttype;
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+Metadata.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 | /**
13 | UIImage category for image metadata, including animation, loop count, format, incremental, etc.
14 | */
15 | @interface UIImage (Metadata)
16 |
17 | /**
18 | * UIKit:
19 | * For static image format, this value is always 0.
20 | * For animated image format, 0 means infinite looping.
21 | * 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.
22 | * AppKit:
23 | * NSImage currently only support animated via GIF imageRep unlike UIImage.
24 | * The getter of this property will get the loop count from GIF imageRep
25 | * The setter of this property will set the loop count from GIF imageRep
26 | */
27 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount;
28 |
29 | /**
30 | * UIKit:
31 | * Check the `images` array property
32 | * AppKit:
33 | * NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep's frame count.
34 | */
35 | @property (nonatomic, assign, readonly) BOOL sd_isAnimated;
36 |
37 | /**
38 | * The image format represent the original compressed image data format.
39 | * 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.
40 | * @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.
41 | */
42 | @property (nonatomic, assign) SDImageFormat sd_imageFormat;
43 |
44 | /**
45 | A bool value indicating whether the image is during incremental decoding and may not contains full pixels.
46 | */
47 | @property (nonatomic, assign) BOOL sd_isIncremental;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCodersManager.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 "SDImageCoder.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`, `GIFCoder`, `APNGCoder`
21 | - calling `coders` will return `@[IOCoder, GIFCoder, APNGCoder]`
22 | - call `[addCoder:[MyCrazyCoder new]]`
23 | - calling `coders` now returns `@[IOCoder, GIFCoder, APNGCoder, MyCrazyCoder]`
24 |
25 | Coders
26 | ------
27 | A coder must conform to the `SDImageCoder` protocol or even to `SDProgressiveImageCoder` 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 SDImageCodersManager : NSObject
33 |
34 | /**
35 | Returns the global shared coders manager instance.
36 | */
37 | @property (nonatomic, class, readonly, nonnull) SDImageCodersManager *sharedManager;
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, 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 | // Seems like TARGET_OS_MAC is always defined (on all platforms).
17 | // To determine if we are running on macOS, use TARGET_OS_OSX in Xcode 8
18 | #if TARGET_OS_OSX
19 | #define SD_MAC 1
20 | #else
21 | #define SD_MAC 0
22 | #endif
23 |
24 | // iOS and tvOS are very similar, UIKit exists on both platforms
25 | // Note: watchOS also has UIKit, but it's very limited
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 | #define SD_UIKIT 1
28 | #else
29 | #define SD_UIKIT 0
30 | #endif
31 |
32 | #if TARGET_OS_IOS
33 | #define SD_IOS 1
34 | #else
35 | #define SD_IOS 0
36 | #endif
37 |
38 | #if TARGET_OS_TV
39 | #define SD_TV 1
40 | #else
41 | #define SD_TV 0
42 | #endif
43 |
44 | #if TARGET_OS_WATCH
45 | #define SD_WATCH 1
46 | #else
47 | #define SD_WATCH 0
48 | #endif
49 |
50 |
51 | #if SD_MAC
52 | #import
53 | #ifndef UIImage
54 | #define UIImage NSImage
55 | #endif
56 | #ifndef UIImageView
57 | #define UIImageView NSImageView
58 | #endif
59 | #ifndef UIView
60 | #define UIView NSView
61 | #endif
62 | #ifndef UIColor
63 | #define UIColor NSColor
64 | #endif
65 | #else
66 | #if SD_UIKIT
67 | #import
68 | #endif
69 | #if SD_WATCH
70 | #import
71 | #ifndef UIView
72 | #define UIView WKInterfaceObject
73 | #endif
74 | #ifndef UIImageView
75 | #define UIImageView WKInterfaceImage
76 | #endif
77 | #endif
78 | #endif
79 |
80 | #ifndef NS_ENUM
81 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
82 | #endif
83 |
84 | #ifndef NS_OPTIONS
85 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
86 | #endif
87 |
88 | #ifndef dispatch_main_async_safe
89 | #define dispatch_main_async_safe(block)\
90 | if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\
91 | block();\
92 | } else {\
93 | dispatch_async(dispatch_get_main_queue(), block);\
94 | }
95 | #endif
96 |
--------------------------------------------------------------------------------
/IPADownload/Main/MainVC.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // IPADownload
4 | //
5 | // Created by Jason on 2018/10/23.
6 | // Copyright © 2018 Jason. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class MainVC: NSViewController {
12 |
13 | @IBOutlet weak var typeSelector: NSPopUpButton!
14 |
15 | @IBOutlet weak var resultTableView: NSTableView!
16 |
17 | @IBOutlet weak var searchFld: NSSearchField!
18 |
19 | lazy var apps = [APPModel]()
20 |
21 | override func viewDidLoad() {
22 | super.viewDidLoad()
23 |
24 | resultTableView.headerView = nil
25 |
26 | resultTableView.rowHeight = 60
27 |
28 | resultTableView.selectionHighlightStyle = .none
29 |
30 | }
31 |
32 | @IBAction func switchClick(_ sender: NSPopUpButton) {
33 |
34 | searchClick(searchFld)
35 | }
36 |
37 | @IBAction func searchClick(_ sender: NSSearchField) {
38 |
39 | if sender.stringValue == "" {
40 |
41 | apps.removeAll()
42 |
43 | resultTableView.reloadData()
44 |
45 | return
46 | }
47 |
48 | let type = (typeSelector.selectedTag() == 0) ? PPSearchType.PPJailbreak : PPSearchType.PPStore
49 |
50 | let vm = APPVM()
51 |
52 | vm.searchApp(sender.stringValue, type) {[weak self] in
53 |
54 | guard let self = self else {
55 | return
56 | }
57 |
58 | self.apps = vm.apps
59 |
60 | self.resultTableView.reloadData()
61 |
62 | }
63 |
64 | }
65 |
66 |
67 |
68 |
69 | override var representedObject: Any? {
70 | didSet {
71 | // Update the view, if already loaded.
72 | }
73 | }
74 |
75 |
76 | }
77 |
78 |
79 | extension MainVC:NSTableViewDelegate,NSTableViewDataSource{
80 |
81 | func numberOfRows(in tableView: NSTableView) -> Int {
82 | return apps.count
83 | }
84 |
85 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
86 |
87 | let app = apps[row]
88 |
89 | let identifier = tableColumn?.identifier
90 |
91 | let cellView = tableView.makeView(withIdentifier: identifier!, owner: self) as? resultCellView
92 |
93 | cellView?.config(app)
94 |
95 | return cellView
96 | }
97 |
98 | }
99 |
100 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/NSImage+Compatibility.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 | /**
14 | This category is provided to easily write cross-platform(AppKit/UIKit) code. For common usage, see `UIImage+Metadata.h`.
15 | */
16 | @interface NSImage (Compatibility)
17 |
18 | /**
19 | The underlying Core Graphics image object. This will actually use `CGImageForProposedRect` with the image size.
20 | */
21 | @property (nonatomic, readonly, nullable) CGImageRef CGImage;
22 | /**
23 | The scale factor of the image. This wil actually use `bestRepresentationForRect` with image size and pixel size to calculate the scale factor. If failed, use the default value 1.0. Should be greater than or equal to 1.0.
24 | */
25 | @property (nonatomic, readonly) CGFloat scale;
26 |
27 | // These are convenience methods to make AppKit's `NSImage` match UIKit's `UIImage` behavior. The scale factor should be greater than or equal to 1.0.
28 |
29 | /**
30 | Returns an image object with the scale factor and orientation. The representation is created from the Core Graphics image object.
31 | @note The difference between this and `initWithCGImage:size` is that `initWithCGImage:size` will actually create a `NSCGImageSnapshotRep` representation and always use `backingScaleFactor` as scale factor. So we should avoid it and use `NSBitmapImageRep` with `initWithCGImage:` instead.
32 | @note The difference between this and UIKit's `UIImage` equivalent method is the way to process orientation. If the provided image orientation is not equal to Up orientation, this method will firstly rotate the CGImage to the correct orientation to work compatible with `NSImageView`. However, UIKit will not actually rotate CGImage and just store it as `imageOrientation` property.
33 |
34 | @param cgImage A Core Graphics image object
35 | @param scale The image scale factor
36 | @param orientation The orientation of the image data
37 | @return The image object
38 | */
39 | - (nonnull instancetype)initWithCGImage:(nonnull CGImageRef)cgImage scale:(CGFloat)scale orientation:(CGImagePropertyOrientation)orientation;
40 |
41 | /**
42 | Returns an image object with the scale factor. The representation is created from the image data.
43 | @note The difference between these this and `initWithData:` is that `initWithData:` will always use `backingScaleFactor` as scale factor.
44 |
45 | @param data The image data
46 | @param scale The image scale factor
47 | @return The image object
48 | */
49 | - (nullable instancetype)initWithData:(nonnull NSData *)data scale:(CGFloat)scale;
50 |
51 | @end
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDMemoryCache.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 | @class SDImageCacheConfig;
12 | /**
13 | A protocol to allow custom memory cache used in SDImageCache.
14 | */
15 | @protocol SDMemoryCache
16 |
17 | @required
18 | /**
19 | Create a new memory cache instance with the specify cache config. You can check `maxMemoryCost` and `maxMemoryCount` used for memory cache.
20 |
21 | @param config The cache config to be used to create the cache.
22 | @return The new memory cache instance.
23 | */
24 | - (nonnull instancetype)initWithConfig:(nonnull SDImageCacheConfig *)config;
25 |
26 | /**
27 | Returns the value associated with a given key.
28 |
29 | @param key An object identifying the value. If nil, just return nil.
30 | @return The value associated with key, or nil if no value is associated with key.
31 | */
32 | - (nullable id)objectForKey:(nonnull id)key;
33 |
34 | /**
35 | Sets the value of the specified key in the cache (0 cost).
36 |
37 | @param object The object to be stored in the cache. If nil, it calls `removeObjectForKey:`.
38 | @param key The key with which to associate the value. If nil, this method has no effect.
39 | @discussion Unlike an NSMutableDictionary object, a cache does not copy the key
40 | objects that are put into it.
41 | */
42 | - (void)setObject:(nullable id)object forKey:(nonnull id)key;
43 |
44 | /**
45 | Sets the value of the specified key in the cache, and associates the key-value
46 | pair with the specified cost.
47 |
48 | @param object The object to store in the cache. If nil, it calls `removeObjectForKey`.
49 | @param key The key with which to associate the value. If nil, this method has no effect.
50 | @param cost The cost with which to associate the key-value pair.
51 | @discussion Unlike an NSMutableDictionary object, a cache does not copy the key
52 | objects that are put into it.
53 | */
54 | - (void)setObject:(nullable id)object forKey:(nonnull id)key cost:(NSUInteger)cost;
55 |
56 | /**
57 | Removes the value of the specified key in the cache.
58 |
59 | @param key The key identifying the value to be removed. If nil, this method has no effect.
60 | */
61 | - (void)removeObjectForKey:(nonnull id)key;
62 |
63 | /**
64 | Empties the cache immediately.
65 | */
66 | - (void)removeAllObjects;
67 |
68 | @end
69 |
70 | /**
71 | A memory cache which auto purge the cache on memory warning and support weak cache.
72 | */
73 | @interface SDMemoryCache : NSCache
74 |
75 | @property (nonatomic, strong, nonnull, readonly) SDImageCacheConfig *config;
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCachesManager.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 "SDImageCacheDefine.h"
11 |
12 | /// Policy for cache operation
13 | typedef NS_ENUM(NSUInteger, SDImageCachesManagerOperationPolicy) {
14 | SDImageCachesManagerOperationPolicySerial, // process all caches serially (from the highest priority to the lowest priority cache by order)
15 | SDImageCachesManagerOperationPolicyConcurrent, // process all caches concurrently
16 | SDImageCachesManagerOperationPolicyHighestOnly, // process the highest priority cache only
17 | SDImageCachesManagerOperationPolicyLowestOnly // process the lowest priority cache only
18 | };
19 |
20 | /**
21 | A caches manager to manage multiple caches.
22 | */
23 | @interface SDImageCachesManager : NSObject
24 |
25 | /**
26 | Returns the global shared caches manager instance. By default we will set [`SDImageCache.sharedImageCache`] into the caches array.
27 | */
28 | @property (nonatomic, class, readonly, nonnull) SDImageCachesManager *sharedManager;
29 |
30 | // These are op policy for cache manager.
31 |
32 | /**
33 | Operation policy for query op.
34 | Defaults to `Serial`, means query all caches serially (one completion called then next begin) until one cache query success (`image` != nil).
35 | */
36 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy queryOperationPolicy;
37 |
38 | /**
39 | Operation policy for store op.
40 | Defaults to `HighestOnly`, means store to the highest priority cache only.
41 | */
42 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy storeOperationPolicy;
43 |
44 | /**
45 | Operation policy for remove op.
46 | Defaults to `Concurrent`, means remove all caches concurrently.
47 | */
48 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy removeOperationPolicy;
49 |
50 | /**
51 | Operation policy for contains op.
52 | Defaults to `Serial`, means check all caches serially (one completion called then next begin) until one cache check success (`containsCacheType` != None).
53 | */
54 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy containsOperationPolicy;
55 |
56 | /**
57 | Operation policy for clear op.
58 | Defaults to `Concurrent`, means clear all caches concurrently.
59 | */
60 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy clearOperationPolicy;
61 |
62 | /**
63 | All caches in caches manager. The caches array is a priority queue, which means the later added cache will have the highest priority
64 | */
65 | @property (nonatomic, copy, nullable) NSArray> *caches;
66 |
67 | /**
68 | Add a new cache to the end of caches array. Which has the highest priority.
69 |
70 | @param cache cache
71 | */
72 | - (void)addCache:(nonnull id)cache;
73 |
74 | /**
75 | Remove a cache in the caches array.
76 |
77 | @param cache cache
78 | */
79 | - (void)removeCache:(nonnull id)cache;
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/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 | #import
39 | #import
40 | #import
41 | #import
42 | #import
43 | #import
44 | #import
45 | #import
46 | #import
47 | #import
48 | #import
49 | #import
50 | #import
51 | #import
52 | #import
53 | #import
54 | #import
55 | #import
56 | #import
57 | #import
58 | #import
59 | #import
60 | #import
61 | #import
62 | #import
63 | #import
64 | #import
65 | #import
66 | #import
67 | #import
68 | #import
69 |
70 | // Mac
71 | #if __has_include()
72 | #import
73 | #endif
74 | #if __has_include()
75 | #import
76 | #endif
77 | #if __has_include()
78 | #import
79 | #endif
80 |
81 | // MapKit
82 | #if __has_include()
83 | #import
84 | #endif
85 |
--------------------------------------------------------------------------------
/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 | /**
13 | UIImage category for convenient image format decoding/encoding.
14 | */
15 | @interface UIImage (MultiFormat)
16 | #pragma mark - Decode
17 | /**
18 | Create and decode a image with the specify image data
19 |
20 | @param data The image data
21 | @return The created image
22 | */
23 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
24 |
25 | /**
26 | Create and decode a image with the specify image data and scale
27 |
28 | @param data The image data
29 | @param scale The image scale factor. Should be greater than or equal to 1.0.
30 | @return The created image
31 | */
32 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale;
33 |
34 | /**
35 | Create and decode a image with the specify image data and scale, allow specify animate/static control
36 |
37 | @param data The image data
38 | @param scale The image scale factor. Should be greater than or equal to 1.0.
39 | @param firstFrameOnly Even if the image data is animated image format, decode the first frame only as static image.
40 | @return The created image
41 | */
42 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly;
43 |
44 | #pragma mark - Encode
45 | /**
46 | Encode the current image to the data, the image format is unspecified
47 |
48 | @return The encoded data. If can't encode, return nil
49 | */
50 | - (nullable NSData *)sd_imageData;
51 |
52 | /**
53 | Encode the current image to data with the specify image format
54 |
55 | @param imageFormat The specify image format
56 | @return The encoded data. If can't encode, return nil
57 | */
58 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat NS_SWIFT_NAME(sd_imageData(as:));
59 |
60 | /**
61 | Encode the current image to data with the specify image format and compression quality
62 |
63 | @param imageFormat The specify image format
64 | @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
65 | @return The encoded data. If can't encode, return nil
66 | */
67 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality NS_SWIFT_NAME(sd_imageData(as:compressionQuality:));
68 |
69 | /**
70 | Encode the current image to data with the specify image format and compression quality, allow specify animate/static control
71 |
72 | @param imageFormat The specify image format
73 | @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
74 | @param firstFrameOnly Even if the image is animated image, encode the first frame only as static image.
75 | @return The encoded data. If can't encode, return nil
76 | */
77 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly NS_SWIFT_NAME(sd_imageData(as:compressionQuality:firstFrameOnly:));
78 |
79 | @end
80 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageIndicator.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 | /**
14 | A protocol to custom the indicator during the image loading.
15 | All of these methods are called from main queue.
16 | */
17 | @protocol SDWebImageIndicator
18 |
19 | @required
20 | /**
21 | The view associate to the indicator.
22 |
23 | @return The indicator view
24 | */
25 | @property (nonatomic, strong, readonly, nonnull) UIView *indicatorView;
26 |
27 | /**
28 | Start the animating for indicator.
29 | */
30 | - (void)startAnimatingIndicator;
31 |
32 | /**
33 | Stop the animating for indicator.
34 | */
35 | - (void)stopAnimatingIndicator;
36 |
37 | @optional
38 | /**
39 | Update the loading progress (0-1.0) for indicator. Optional
40 |
41 | @param progress The progress, value between 0 and 1.0
42 | */
43 | - (void)updateIndicatorProgress:(double)progress;
44 |
45 | @end
46 |
47 | #pragma mark - Activity Indicator
48 |
49 | /**
50 | Activity indicator class.
51 | for UIKit(macOS), it use a `UIActivityIndicatorView`.
52 | for AppKit(macOS), it use a `NSProgressIndicator` with the spinning style.
53 | */
54 | @interface SDWebImageActivityIndicator : NSObject
55 |
56 | #if SD_UIKIT
57 | @property (nonatomic, strong, readonly, nonnull) UIActivityIndicatorView *indicatorView;
58 | #else
59 | @property (nonatomic, strong, readonly, nonnull) NSProgressIndicator *indicatorView;
60 | #endif
61 |
62 | @end
63 |
64 | /**
65 | Convenience way to use activity indicator.
66 | */
67 | @interface SDWebImageActivityIndicator (Conveniences)
68 |
69 | /// gray-style activity indicator
70 | @property (nonatomic, class, nonnull, readonly) SDWebImageActivityIndicator *grayIndicator;
71 | /// large gray-style activity indicator
72 | @property (nonatomic, class, nonnull, readonly) SDWebImageActivityIndicator *grayLargeIndicator;
73 | /// white-style activity indicator
74 | @property (nonatomic, class, nonnull, readonly) SDWebImageActivityIndicator *whiteIndicator;
75 | /// large white-style activity indicator
76 | @property (nonatomic, class, nonnull, readonly) SDWebImageActivityIndicator *whiteLargeIndicator;
77 |
78 | @end
79 |
80 | #pragma mark - Progress Indicator
81 |
82 | /**
83 | Progress indicator class.
84 | for UIKit(macOS), it use a `UIProgressView`.
85 | for AppKit(macOS), it use a `NSProgressIndicator` with the bar style.
86 | */
87 | @interface SDWebImageProgressIndicator : NSObject
88 |
89 | #if SD_UIKIT
90 | @property (nonatomic, strong, readonly, nonnull) UIProgressView *indicatorView;
91 | #else
92 | @property (nonatomic, strong, readonly, nonnull) NSProgressIndicator *indicatorView;
93 | #endif
94 |
95 | @end
96 |
97 | /**
98 | Convenience way to create progress indicator. Remember to specify the indicator width or use layout constraint if need.
99 | */
100 | @interface SDWebImageProgressIndicator (Conveniences)
101 |
102 | /// default-style progress indicator
103 | @property (nonatomic, class, nonnull, readonly) SDWebImageProgressIndicator *defaultIndicator;
104 | /// bar-style progress indicator
105 | @property (nonatomic, class, nonnull, readonly) SDWebImageProgressIndicator *barIndicator API_UNAVAILABLE(macos, tvos);
106 |
107 | @end
108 |
109 | #endif
110 |
--------------------------------------------------------------------------------
/IPADownload.xcodeproj/xcshareddata/xcschemes/IPADownload.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDAnimatedImageView.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 "SDAnimatedImage.h"
14 |
15 | /**
16 | A drop-in replacement for UIImageView/NSImageView, you can use this for animated image rendering.
17 | Call `setImage:` with `UIImage(NSImage)` which conform to `SDAnimatedImage` protocol will start animated image rendering. Call with normal UIImage(NSImage) will back to normal UIImageView(NSImageView) rendering
18 | For UIKit: use `-startAnimating`, `-stopAnimating` to control animating. `isAnimating` to check animation state.
19 | For AppKit: use `-setAnimates:` to control animating, `animates` to check animation state. This view is layer-backed.
20 | */
21 | @interface SDAnimatedImageView : UIImageView
22 |
23 | /**
24 | Current display frame image.
25 | */
26 | @property (nonatomic, strong, readonly, nullable) UIImage *currentFrame;
27 | /**
28 | Current frame index, zero based. This value is KVO Compliance.
29 | */
30 | @property (nonatomic, assign, readonly) NSUInteger currentFrameIndex;
31 | /**
32 | Current loop count since its latest animating. This value is KVO Compliance.
33 | */
34 | @property (nonatomic, assign, readonly) NSUInteger currentLoopCount;
35 | /**
36 | YES to choose `animationRepeatCount` property for animation loop count. No to use animated image's `animatedImageLoopCount` instead.
37 | Default is NO.
38 | */
39 | @property (nonatomic, assign) BOOL shouldCustomLoopCount;
40 | /**
41 | Total loop count for animated image rendering. Default is animated image's loop count.
42 | If you need to set custom loop count, set `shouldCustomLoopCount` to YES and change this value.
43 | This class override UIImageView's `animationRepeatCount` property on iOS, use this property as well.
44 | */
45 | @property (nonatomic, assign) NSInteger animationRepeatCount;
46 | /**
47 | Provide a max buffer size by bytes. This is used to adjust frame buffer count and can be useful when the decoding cost is expensive (such as Animated WebP software decoding). Default is 0.
48 | `0` means automatically adjust by calculating current memory usage.
49 | `1` means without any buffer cache, each of frames will be decoded and then be freed after rendering. (Lowest Memory and Highest CPU)
50 | `NSUIntegerMax` means cache all the buffer. (Lowest CPU and Highest Memory)
51 | */
52 | @property (nonatomic, assign) NSUInteger maxBufferSize;
53 | /**
54 | Whehter or not to enable incremental image load for animated image. This is for the animated image which `sd_isIncremental` is YES (See `UIImage+Metadata.h`). If enable, animated image rendering will stop at the last frame available currently, and continue when another `setImage:` trigger, where the new animated image's `animatedImageData` should be updated from the previous one. If the `sd_isIncremental` is NO. The incremental image load stop.
55 | @note If you are confused about this description, open Chrome browser to view some large GIF images with low network speed to see the animation behavior.
56 | @note The best practice to use incremental load is using `initWithAnimatedCoder:scale:` in `SDAnimatedImage` with animated coder which conform to `SDProgressiveImageCoder` as well. Then call incremental update and incremental decode method to produce the image.
57 | Default is YES. Set to NO to only render the static poster for incremental animated image.
58 | */
59 | @property (nonatomic, assign) BOOL shouldIncrementalLoad;
60 |
61 | #if SD_UIKIT
62 | /**
63 | You can specify a runloop mode to let it rendering.
64 | Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device
65 | */
66 | @property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode;
67 | #endif
68 | @end
69 |
70 | #endif
71 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDWebImageDownloaderConfig.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 | /// Operation execution order
13 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
14 | /**
15 | * Default value. All download operations will execute in queue style (first-in-first-out).
16 | */
17 | SDWebImageDownloaderFIFOExecutionOrder,
18 |
19 | /**
20 | * All download operations will execute in stack style (last-in-first-out).
21 | */
22 | SDWebImageDownloaderLIFOExecutionOrder
23 | };
24 |
25 | /**
26 | The class contains all the config for image downloader
27 | @note This class conform to NSCopying, make sure to add the property in `copyWithZone:` as well.
28 | */
29 | @interface SDWebImageDownloaderConfig : NSObject
30 |
31 | /**
32 | Gets the default downloader config used for shared instance or initialization when it does not provide any downloader config. Such as `SDWebImageDownloader.sharedDownloader`.
33 | @note You can modify the property on default downloader config, which can be used for later created downloader instance. The already created downloader instance does not get affected.
34 | */
35 | @property (nonatomic, class, readonly, nonnull) SDWebImageDownloaderConfig *defaultDownloaderConfig;
36 |
37 | /**
38 | * The maximum number of concurrent downloads.
39 | * Defaults to 6.
40 | */
41 | @property (nonatomic, assign) NSInteger maxConcurrentDownloads;
42 |
43 | /**
44 | * The timeout value (in seconds) for each download operation.
45 | * Defaults to 15.0.
46 | */
47 | @property (nonatomic, assign) NSTimeInterval downloadTimeout;
48 |
49 | /**
50 | * The minimum interval about progress percent during network downloading. Which means the next progress callback and current progress callback's progress percent difference should be larger or equal to this value. However, the final finish download progress callback does not get effected.
51 | * The value should be 0.0-1.0.
52 | * @note If you're using progressive decoding feature, this will also effect the image refresh rate.
53 | * @note This value may enhance the performance if you don't want progress callback too frequently.
54 | * Defaults to 0, which means each time we receive the new data from URLSession, we callback the progressBlock immediately.
55 | */
56 | @property (nonatomic, assign) double minimumProgressInterval;
57 |
58 | /**
59 | * The custom session configuration in use by NSURLSession. If you don't provide one, we will use `defaultSessionConfiguration` instead.
60 | * Defatuls to nil.
61 | * @note This property does not support dynamic changes, means it's immutable after the downloader instance initialized.
62 | */
63 | @property (nonatomic, strong, nullable) NSURLSessionConfiguration *sessionConfiguration;
64 |
65 | /**
66 | * Gets/Sets a subclass of `SDWebImageDownloaderOperation` as the default
67 | * `NSOperation` to be used each time SDWebImage constructs a request
68 | * operation to download an image.
69 | * Defaults to nil.
70 | * @note Passing `NSOperation` to set as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`.
71 | */
72 | @property (nonatomic, assign, nullable) Class operationClass;
73 |
74 | /**
75 | * Changes download operations execution order.
76 | * Defaults to `SDWebImageDownloaderFIFOExecutionOrder`.
77 | */
78 | @property (nonatomic, assign) SDWebImageDownloaderExecutionOrder executionOrder;
79 |
80 | /**
81 | * Set the default URL credential to be set for request operations.
82 | * Defaults to nil.
83 | */
84 | @property (nonatomic, copy, nullable) NSURLCredential *urlCredential;
85 |
86 | /**
87 | * Set username using for HTTP Basic authentication.
88 | * Defaults to nil.
89 | */
90 | @property (nonatomic, copy, nullable) NSString *username;
91 |
92 | /**
93 | * Set password using for HTTP Basic authentication.
94 | * Defautls to nil.
95 | */
96 | @property (nonatomic, copy, nullable) NSString *password;
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/IPADownload/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 | let requestHeader:HTTPHeaders = ["Content-Type": "application/json"]
66 |
67 | var params = parameters
68 |
69 | if params == nil {
70 | params = [String:Any]()
71 | }
72 |
73 | manager?.request(URLString, method: method, parameters: params, encoding: JSONEncoding.default,headers: requestHeader).responseJSON(completionHandler:{(response) in
74 |
75 | switch response.result.isSuccess{
76 | case true:
77 |
78 | let obj = response.result.value as AnyObject
79 |
80 | completion(obj)
81 |
82 | case false: break
83 |
84 | }
85 |
86 | })
87 | }
88 |
89 |
90 | func download(URLString:String,title:String,progressHandler:@escaping ((_ progress:Double)->()),completion:@escaping (()->())) {
91 |
92 | let destination: DownloadRequest.DownloadFileDestination = { _, _ in
93 | let downloadURL = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask)[0]
94 | let fileURL = downloadURL.appendingPathComponent("\(title).ipa")
95 |
96 | return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
97 | }
98 |
99 | manager?.download(URLString, to: destination).downloadProgress(closure: { (progress) in
100 |
101 | let value = Double(progress.completedUnitCount)/Double(progress.totalUnitCount)
102 |
103 | progressHandler(value)
104 |
105 | }).responseData(completionHandler: { (response) in
106 |
107 | switch response.result {
108 |
109 | case .success:
110 |
111 | print("文件下载完毕: \(response)")
112 |
113 | case .failure:
114 |
115 |
116 | break
117 | }
118 |
119 | completion()
120 |
121 | })
122 |
123 |
124 |
125 | }
126 |
127 | }
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/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 | #if SD_UIKIT
15 | typedef UIViewAnimationOptions SDWebImageAnimationOptions;
16 | #else
17 | typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) {
18 | SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext`
19 | };
20 | #endif
21 |
22 | typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL);
23 | typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image);
24 | typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
25 |
26 | /**
27 | 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
28 | for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation.
29 | for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block.
30 | @note 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.
31 | */
32 | @interface SDWebImageTransition : NSObject
33 |
34 | /**
35 | 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
36 | */
37 | @property (nonatomic, assign) BOOL avoidAutoSetImage;
38 | /**
39 | The duration of the transition animation, measured in seconds. Defaults to 0.5.
40 | */
41 | @property (nonatomic, assign) NSTimeInterval duration;
42 | /**
43 | The timing function used for all animations within this transition animation (macOS).
44 | */
45 | @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction API_UNAVAILABLE(ios, tvos, watchos);
46 | /**
47 | A mask of options indicating how you want to perform the animations.
48 | */
49 | @property (nonatomic, assign) SDWebImageAnimationOptions animationOptions;
50 | /**
51 | A block object to be executed before the animation sequence starts.
52 | */
53 | @property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares;
54 | /**
55 | A block object that contains the changes you want to make to the specified view.
56 | */
57 | @property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations;
58 | /**
59 | A block object to be executed when the animation sequence ends.
60 | */
61 | @property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion;
62 |
63 | @end
64 |
65 | /**
66 | Convenience way to create transition. Remember to specify the duration if needed.
67 | for UIKit, these transition just use the correspond `animationOptions`. By default we enable `UIViewAnimationOptionAllowUserInteraction` to allow user interaction during transition.
68 | for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it.
69 | */
70 | @interface SDWebImageTransition (Conveniences)
71 |
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 |
87 | @end
88 |
89 | #endif
90 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDDiskCache.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 | @class SDImageCacheConfig;
12 | /**
13 | A protocol to allow custom disk cache used in SDImageCache.
14 | */
15 | @protocol SDDiskCache
16 |
17 | // All of these method are called from the same global queue to avoid blocking on main queue and thread-safe problem. But it's also recommend to ensure thread-safe yourself using lock or other ways.
18 | @required
19 | /**
20 | Create a new disk cache based on the specified path. You can check `maxDiskSize` and `maxDiskAge` used for disk cache.
21 |
22 | @param cachePath Full path of a directory in which the cache will write data.
23 | Once initialized you should not read and write to this directory.
24 | @param config The cache config to be used to create the cache.
25 |
26 | @return A new cache object, or nil if an error occurs.
27 | */
28 | - (nullable instancetype)initWithCachePath:(nonnull NSString *)cachePath config:(nonnull SDImageCacheConfig *)config;
29 |
30 | /**
31 | Returns a boolean value that indicates whether a given key is in cache.
32 | This method may blocks the calling thread until file read finished.
33 |
34 | @param key A string identifying the data. If nil, just return NO.
35 | @return Whether the key is in cache.
36 | */
37 | - (BOOL)containsDataForKey:(nonnull NSString *)key;
38 |
39 | /**
40 | Returns the data associated with a given key.
41 | This method may blocks the calling thread until file read finished.
42 |
43 | @param key A string identifying the data. If nil, just return nil.
44 | @return The value associated with key, or nil if no value is associated with key.
45 | */
46 | - (nullable NSData *)dataForKey:(nonnull NSString *)key;
47 |
48 | /**
49 | Sets the value of the specified key in the cache.
50 | This method may blocks the calling thread until file write finished.
51 |
52 | @param data The data to be stored in the cache.
53 | @param key The key with which to associate the value. If nil, this method has no effect.
54 | */
55 | - (void)setData:(nullable NSData *)data forKey:(nonnull NSString *)key;
56 |
57 | /**
58 | Removes the value of the specified key in the cache.
59 | This method may blocks the calling thread until file delete finished.
60 |
61 | @param key The key identifying the value to be removed. If nil, this method has no effect.
62 | */
63 | - (void)removeDataForKey:(nonnull NSString *)key;
64 |
65 | /**
66 | Empties the cache.
67 | This method may blocks the calling thread until file delete finished.
68 | */
69 | - (void)removeAllData;
70 |
71 | /**
72 | Removes the expired data from the cache. You can choose the data to remove base on `ageLimit`, `countLimit` and `sizeLimit` options.
73 | */
74 | - (void)removeExpiredData;
75 |
76 | /**
77 | The cache path for key
78 |
79 | @param key A string identifying the value
80 | @return The cache path for key. Or nil if the key can not associate to a path
81 | */
82 | - (nullable NSString *)cachePathForKey:(nonnull NSString *)key;
83 |
84 | /**
85 | Returns the number of data in this cache.
86 | This method may blocks the calling thread until file read finished.
87 |
88 | @return The total data count.
89 | */
90 | - (NSUInteger)totalCount;
91 |
92 | /**
93 | Returns the total size (in bytes) of data in this cache.
94 | This method may blocks the calling thread until file read finished.
95 |
96 | @return The total data size in bytes.
97 | */
98 | - (NSUInteger)totalSize;
99 |
100 | @end
101 |
102 | /**
103 | The built-in disk cache.
104 | */
105 | @interface SDDiskCache : NSObject
106 | /**
107 | Cache Config object - storing all kind of settings.
108 | */
109 | @property (nonatomic, strong, readonly, nonnull) SDImageCacheConfig *config;
110 |
111 | - (nonnull instancetype)init NS_UNAVAILABLE;
112 |
113 | /**
114 | Move the cache directory from old location to new location, the old location will be removed after finish.
115 | If the old location does not exist, does nothing.
116 | If the new location does not exist, only do a movement of directory.
117 | If the new location does exist, will move and merge the files from old location.
118 | If the new location does exist, but is not a directory, will remove it and do a movement of directory.
119 |
120 | @param srcPath old location of cache directory
121 | @param dstPath new location of cache directory
122 | */
123 | - (void)moveCacheDirectoryFromPath:(nonnull NSString *)srcPath toPath:(nonnull NSString *)dstPath;
124 |
125 | @end
126 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCoderHelper.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 "SDImageFrame.h"
12 |
13 | /**
14 | Provide some common helper methods for building the image decoder/encoder.
15 | */
16 | @interface SDImageCoderHelper : NSObject
17 |
18 | /**
19 | Return an animated image with frames array.
20 | 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.
21 | 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)
22 |
23 | @param frames The frames array. If no frames or frames is empty, return nil
24 | @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit)
25 | */
26 | + (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames;
27 |
28 | /**
29 | Return frames array from an animated image.
30 | For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage.
31 | For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array.
32 |
33 | @param animatedImage A animated image. If it's not animated, return nil
34 | @return The frames array
35 | */
36 | + (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage NS_SWIFT_NAME(frames(from:));
37 |
38 | /**
39 | Return the shared device-dependent RGB color space. This follows The Get Rule.
40 | On iOS, it's created with deviceRGB (if available, use sRGB).
41 | On macOS, it's from the screen colorspace (if failed, use deviceRGB)
42 | Because it's shared, you should not retain or release this object.
43 |
44 | @return The device-dependent RGB color space
45 | */
46 | + (CGColorSpaceRef _Nonnull)colorSpaceGetDeviceRGB CF_RETURNS_NOT_RETAINED;
47 |
48 | /**
49 | Check whether CGImage contains alpha channel.
50 |
51 | @param cgImage The CGImage
52 | @return Return YES if CGImage contains alpha channel, otherwise return NO
53 | */
54 | + (BOOL)CGImageContainsAlpha:(_Nonnull CGImageRef)cgImage;
55 |
56 | /**
57 | Create a decoded CGImage by the provided CGImage. This follows The Create Rule and you are response to call release after usage.
58 | It will detect whether image contains alpha channel, then create a new bitmap context with the same size of image, and draw it. This can ensure that the image do not need extra decoding after been set to the imageView.
59 | @note This actually call `CGImageCreateDecoded:orientation:` with the Up orientation.
60 |
61 | @param cgImage The CGImage
62 | @return A new created decoded image
63 | */
64 | + (CGImageRef _Nullable)CGImageCreateDecoded:(_Nonnull CGImageRef)cgImage CF_RETURNS_RETAINED;
65 |
66 | /**
67 | Create a decoded CGImage by the provided CGImage and orientation. This follows The Create Rule and you are response to call release after usage.
68 | It will detect whether image contains alpha channel, then create a new bitmap context with the same size of image, and draw it. This can ensure that the image do not need extra decoding after been set to the imageView.
69 |
70 | @param cgImage The CGImage
71 | @param orientation The EXIF image orientation.
72 | @return A new created decoded image
73 | */
74 | + (CGImageRef _Nullable)CGImageCreateDecoded:(_Nonnull CGImageRef)cgImage orientation:(CGImagePropertyOrientation)orientation CF_RETURNS_RETAINED;
75 |
76 | /**
77 | Return the decoded image by the provided image. This one unlike `CGImageCreateDecoded:`, will not decode the image which contains alpha channel or animated image
78 | @param image The image to be decoded
79 | @return The decoded image
80 | */
81 | + (UIImage * _Nullable)decodedImageWithImage:(UIImage * _Nullable)image;
82 |
83 | /**
84 | Return the decoded and probably scaled down image by the provided image. If the image is large than the limit size, will try to scale down. Or just works as `decodedImageWithImage:`
85 |
86 | @param image The image to be decoded and scaled down
87 | @param bytes The limit bytes size. Provide 0 to use the build-in limit.
88 | @return The decoded and probably scaled down image
89 | */
90 | + (UIImage * _Nullable)decodedAndScaledDownImageWithImage:(UIImage * _Nullable)image limitBytes:(NSUInteger)bytes;
91 |
92 | #if SD_UIKIT || SD_WATCH
93 | /**
94 | Convert an EXIF image orientation to an iOS one.
95 |
96 | @param exifOrientation EXIF orientation
97 | @return iOS orientation
98 | */
99 | + (UIImageOrientation)imageOrientationFromEXIFOrientation:(CGImagePropertyOrientation)exifOrientation NS_SWIFT_NAME(imageOrientation(from:));
100 |
101 | /**
102 | Convert an iOS orientation to an EXIF image orientation.
103 |
104 | @param imageOrientation iOS orientation
105 | @return EXIF orientation
106 | */
107 | + (CGImagePropertyOrientation)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation;
108 | #endif
109 |
110 | @end
111 |
--------------------------------------------------------------------------------
/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 "SDWebImageDefine.h"
11 | #import "SDWebImageManager.h"
12 | #import "SDWebImageTransition.h"
13 | #import "SDWebImageIndicator.h"
14 |
15 | /**
16 | The value specify that the image progress unit count cannot be determined because the progressBlock is not been called.
17 | */
18 | FOUNDATION_EXPORT const int64_t SDWebImageProgressUnitCountUnknown; /* 1LL */
19 |
20 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL);
21 |
22 | /**
23 | Integrates SDWebImage async downloading and caching of remote images with UIView subclass.
24 | */
25 | @interface UIView (WebCache)
26 |
27 | /**
28 | * Get the current image URL.
29 | *
30 | * @note Note that because of the limitations of categories this property can get out of sync if you use setImage: directly.
31 | */
32 | @property (nonatomic, strong, readonly, nullable) NSURL *sd_imageURL;
33 |
34 | /**
35 | * The current image loading progress associated to the view. The unit count is the received size and excepted size of download.
36 | * 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).
37 | * @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.
38 | * @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
39 | * @note Note that because of the limitations of categories this property can get out of sync if you update the progress directly.
40 | */
41 | @property (nonatomic, strong, null_resettable) NSProgress *sd_imageProgress;
42 |
43 | /**
44 | * Set the imageView `image` with an `url` and optionally a placeholder image.
45 | *
46 | * The download is asynchronous and cached.
47 | *
48 | * @param url The url for the image.
49 | * @param placeholder The image to be set initially, until the image request finishes.
50 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
51 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
52 | * @param setImageBlock Block used for custom set image code. If not provide, use the built-in set image code (supports `UIImageView/NSImageView` and `UIButton/NSButton` currently)
53 | * @param progressBlock A block called while image is downloading
54 | * @note the progress block is executed on a background queue
55 | * @param completedBlock A block called when operation has been completed.
56 | * This block has no return value and takes the requested UIImage as first parameter and the NSData representation as second parameter.
57 | * In case of error the image parameter is nil and the third parameter may contain an NSError.
58 | *
59 | * The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache
60 | * or from the memory cache or from the network.
61 | *
62 | * The fith parameter normally is always YES. However, if you provide SDWebImageAvoidAutoSetImage with SDWebImageProgressiveLoad options to enable progressive downloading and set the image yourself. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
63 | * block is called a last time with the full image and the last parameter set to YES.
64 | *
65 | * The last parameter is the original image URL
66 | */
67 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url
68 | placeholderImage:(nullable UIImage *)placeholder
69 | options:(SDWebImageOptions)options
70 | context:(nullable SDWebImageContext *)context
71 | setImageBlock:(nullable SDSetImageBlock)setImageBlock
72 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
73 | completed:(nullable SDInternalCompletionBlock)completedBlock;
74 |
75 | /**
76 | * Cancel the current image load
77 | */
78 | - (void)sd_cancelCurrentImageLoad;
79 |
80 | #if SD_UIKIT || SD_MAC
81 |
82 | #pragma mark - Image Transition
83 |
84 | /**
85 | The image transition when image load finished. See `SDWebImageTransition`.
86 | If you specify nil, do not do transition. Defautls to nil.
87 | */
88 | @property (nonatomic, strong, nullable) SDWebImageTransition *sd_imageTransition;
89 |
90 | #pragma mark - Image Indicator
91 |
92 | /**
93 | The image indicator during the image loading. If you do not need indicator, specify nil. Defaults to nil
94 | The setter will remove the old indicator view and add new indicator view to current view's subview.
95 | @note Because this is UI related, you should access only from the main queue.
96 | */
97 | @property (nonatomic, strong, nullable) id sd_imageIndicator;
98 |
99 | #endif
100 |
101 | @end
102 |
--------------------------------------------------------------------------------
/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 | /// Image Cache Expire Type
13 | typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) {
14 | /**
15 | * When the image is accessed it will update this value
16 | */
17 | SDImageCacheConfigExpireTypeAccessDate,
18 | /**
19 | * The image was obtained from the disk cache (Default)
20 | */
21 | SDImageCacheConfigExpireTypeModificationDate
22 | };
23 |
24 | /**
25 | The class contains all the config for image cache
26 | @note This class conform to NSCopying, make sure to add the property in `copyWithZone:` as well.
27 | */
28 | @interface SDImageCacheConfig : NSObject
29 |
30 | /**
31 | Gets the default cache config used for shared instance or initialization when it does not provide any cache config. Such as `SDImageCache.sharedImageCache`.
32 | @note You can modify the property on default cache config, which can be used for later created cache instance. The already created cache instance does not get affected.
33 | */
34 | @property (nonatomic, class, readonly, nonnull) SDImageCacheConfig *defaultCacheConfig;
35 |
36 | /**
37 | * Whether or not to disable iCloud backup
38 | * Defaults to YES.
39 | */
40 | @property (assign, nonatomic) BOOL shouldDisableiCloud;
41 |
42 | /**
43 | * Whether or not to use memory cache
44 | * @note When the memory cache is disabled, the weak memory cache will also be disabled.
45 | * Defaults to YES.
46 | */
47 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory;
48 |
49 | /*
50 | * 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.
51 | * However when memory warning is triggered, since the weak maptable does not hold a strong reference to image instance, 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.
52 | * Defautls to YES. You can change this option dynamically.
53 | */
54 | @property (assign, nonatomic) BOOL shouldUseWeakMemoryCache;
55 |
56 | /**
57 | * Whether or not to remove the expired disk data when application entering the background. (Not works for macOS)
58 | * Defaults to YES.
59 | */
60 | @property (assign, nonatomic) BOOL shouldRemoveExpiredDataWhenEnterBackground;
61 |
62 | /**
63 | * The reading options while reading cache from disk.
64 | * Defaults to 0. You can set this to `NSDataReadingMappedIfSafe` to improve performance.
65 | */
66 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions;
67 |
68 | /**
69 | * The writing options while writing cache to disk.
70 | * Defaults to `NSDataWritingAtomic`. You can set this to `NSDataWritingWithoutOverwriting` to prevent overwriting an existing file.
71 | */
72 | @property (assign, nonatomic) NSDataWritingOptions diskCacheWritingOptions;
73 |
74 | /**
75 | * The maximum length of time to keep an image in the disk cache, in seconds.
76 | * Setting this to a negative value means no expiring.
77 | * Setting this to zero means that all cached files would be removed when do expiration check.
78 | * Defaults to 1 week.
79 | */
80 | @property (assign, nonatomic) NSTimeInterval maxDiskAge;
81 |
82 | /**
83 | * The maximum size of the disk cache, in bytes.
84 | * Defaults to 0. Which means there is no cache size limit.
85 | */
86 | @property (assign, nonatomic) NSUInteger maxDiskSize;
87 |
88 | /**
89 | * The maximum "total cost" of the in-memory image cache. The cost function is the bytes size held in memory.
90 | * @note The memory cost is bytes size in memory, but not simple pixels count. For common ARGB8888 image, one pixel is 4 bytes (32 bits).
91 | * Defaults to 0. Which means there is no memory cost limit.
92 | */
93 | @property (assign, nonatomic) NSUInteger maxMemoryCost;
94 |
95 | /**
96 | * The maximum number of objects in-memory image cache should hold.
97 | * Defaults to 0. Which means there is no memory count limit.
98 | */
99 | @property (assign, nonatomic) NSUInteger maxMemoryCount;
100 |
101 | /*
102 | * The attribute which the clear cache will be checked against when clearing the disk cache
103 | * Default is Modified Date
104 | */
105 | @property (assign, nonatomic) SDImageCacheConfigExpireType diskCacheExpireType;
106 |
107 | /**
108 | * The custom file manager for disk cache. Pass nil to let disk cache choose the proper file manager.
109 | * Defaults to nil.
110 | * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
111 | * @note Since `NSFileManager` does not support `NSCopying`. We just pass this by reference during copying. So it's not recommend to set this value on `defaultCacheConfig`.
112 | */
113 | @property (strong, nonatomic, nullable) NSFileManager *fileManager;
114 |
115 | /**
116 | * The custom memory cache class. Provided class instance must conform to `SDMemoryCache` protocol to allow usage.
117 | * Defaults to built-in `SDMemoryCache` class.
118 | * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
119 | */
120 | @property (assign, nonatomic, nonnull) Class memoryCacheClass;
121 |
122 | /**
123 | * The custom disk cache class. Provided class instance must conform to `SDDiskCache` protocol to allow usage.
124 | * Defaults to built-in `SDDiskCache` class.
125 | * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
126 | */
127 | @property (assign ,nonatomic, nonnull) Class diskCacheClass;
128 |
129 | @end
130 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/UIImage+Transform.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 | typedef NS_ENUM(NSUInteger, SDImageScaleMode) {
12 | SDImageScaleModeFill = 0,
13 | SDImageScaleModeAspectFit = 1,
14 | SDImageScaleModeAspectFill = 2
15 | };
16 |
17 | #if SD_UIKIT || SD_WATCH
18 | typedef UIRectCorner SDRectCorner;
19 | #else
20 | typedef NS_OPTIONS(NSUInteger, SDRectCorner) {
21 | SDRectCornerTopLeft = 1 << 0,
22 | SDRectCornerTopRight = 1 << 1,
23 | SDRectCornerBottomLeft = 1 << 2,
24 | SDRectCornerBottomRight = 1 << 3,
25 | SDRectCornerAllCorners = ~0UL
26 | };
27 | #endif
28 |
29 | /**
30 | Provide some commen method for `UIImage`.
31 | Image process is based on Core Graphics and vImage.
32 | */
33 | @interface UIImage (Transform)
34 |
35 | #pragma mark - Image Geometry
36 |
37 | /**
38 | Returns a new image which is resized from this image.
39 | You can specify a larger or smaller size than the image size. The image content will be changed with the scale mode.
40 |
41 | @param size The new size to be resized, values should be positive.
42 | @param scaleMode The scale mode for image content.
43 | @return The new image with the given size.
44 | */
45 | - (nullable UIImage *)sd_resizedImageWithSize:(CGSize)size scaleMode:(SDImageScaleMode)scaleMode;
46 |
47 | /**
48 | Returns a new image which is cropped from this image.
49 |
50 | @param rect Image's inner rect.
51 | @return The new image with the cropping rect.
52 | */
53 | - (nullable UIImage *)sd_croppedImageWithRect:(CGRect)rect;
54 |
55 | /**
56 | Rounds a new image with a given corner radius and corners.
57 |
58 | @param cornerRadius The radius of each corner oval. Values larger than half the
59 | rectangle's width or height are clamped appropriately to
60 | half the width or height.
61 | @param corners A bitmask value that identifies the corners that you want
62 | rounded. You can use this parameter to round only a subset
63 | of the corners of the rectangle.
64 | @param borderWidth The inset border line width. Values larger than half the rectangle's
65 | width or height are clamped appropriately to half the width
66 | or height.
67 | @param borderColor The border stroke color. nil means clear color.
68 | @return The new image with the round corner.
69 | */
70 | - (nullable UIImage *)sd_roundedCornerImageWithRadius:(CGFloat)cornerRadius
71 | corners:(SDRectCorner)corners
72 | borderWidth:(CGFloat)borderWidth
73 | borderColor:(nullable UIColor *)borderColor;
74 |
75 | /**
76 | Returns a new rotated image (relative to the center).
77 |
78 | @param angle Rotated radians in counterclockwise.⟲
79 | @param fitSize YES: new image's size is extend to fit all content.
80 | NO: image's size will not change, content may be clipped.
81 | @return The new image with the rotation.
82 | */
83 | - (nullable UIImage *)sd_rotatedImageWithAngle:(CGFloat)angle fitSize:(BOOL)fitSize;
84 |
85 | /**
86 | Returns a new horizontally(vertically) flipped image.
87 |
88 | @param horizontal YES to flip the image horizontally. ⇋
89 | @param vertical YES to flip the image vertically. ⥯
90 | @return The new image with the flipping.
91 | */
92 | - (nullable UIImage *)sd_flippedImageWithHorizontal:(BOOL)horizontal vertical:(BOOL)vertical;
93 |
94 | #pragma mark - Image Blending
95 |
96 | /**
97 | Return a tinted image with the given color. This actually use alpha blending of current image and the tint color.
98 |
99 | @param tintColor The tint color.
100 | @return The new image with the tint color.
101 | */
102 | - (nullable UIImage *)sd_tintedImageWithColor:(nonnull UIColor *)tintColor;
103 |
104 | /**
105 | Return the pixel color at specify position. The point is from the top-left to the bottom-right and 0-based. The returned the color is always be RGBA format. The image must be CG-based.
106 | @note The point's x/y should not be smaller than 0, or greater than or equal to width/height.
107 | @note The overhead of object creation means this method is best suited for infrequent color sampling. For heavy image processing, grab the raw bitmap data and process yourself.
108 |
109 | @param point The position of pixel
110 | @return The color for specify pixel, or nil if any error occur
111 | */
112 | - (nullable UIColor *)sd_colorAtPoint:(CGPoint)point;
113 |
114 | /**
115 | Return the pixel color array with specify rectangle. The rect is from the top-left to the bottom-right and 0-based. The returned the color is always be RGBA format. The image must be CG-based.
116 | @note The rect's width/height should not be smaller than or equal to 0. The minX/minY should not be smaller than 0. The maxX/maxY should not be greater than width/height. Attention this limit is different from `sd_colorAtPoint:` (point: (0, 0) like rect: (0, 0, 1, 1))
117 | @note The overhead of object creation means this method is best suited for infrequent color sampling. For heavy image processing, grab the raw bitmap data and process yourself.
118 |
119 | @param rect The rectangle of pixels
120 | @return The color array for specify pixels, or nil if any error occur
121 | */
122 | - (nullable NSArray *)sd_colorsWithRect:(CGRect)rect;
123 |
124 | #pragma mark - Image Effect
125 |
126 | /**
127 | Return a new image applied a blur effect.
128 |
129 | @param blurRadius The radius of the blur in points, 0 means no blur effect.
130 |
131 | @return The new image with blur effect, or nil if an error occurs (e.g. no enough memory).
132 | */
133 | - (nullable UIImage *)sd_blurredImageWithRadius:(CGFloat)blurRadius;
134 |
135 | #if SD_UIKIT || SD_MAC
136 | /**
137 | Return a new image applied a CIFilter.
138 |
139 | @param filter The CIFilter to be applied to the image.
140 | @return The new image with the CIFilter, or nil if an error occurs (e.g. no
141 | enough memory).
142 | */
143 | - (nullable UIImage *)sd_filteredImageWithFilter:(nonnull CIFilter *)filter;
144 | #endif
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDAnimatedImage.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 "SDImageCoder.h"
11 |
12 |
13 | /**
14 | This is the protocol for SDAnimatedImage class only but not for SDAnimatedImageCoder. If you want to provide a custom animated image class with full advanced function, you can conform to this instead of the base protocol.
15 | */
16 | @protocol SDAnimatedImage
17 |
18 | @required
19 | /**
20 | Initializes and returns the image object with the specified data, scale factor and possible animation decoding options.
21 | @note We use this to create animated image instance for normal animation decoding.
22 |
23 | @param data The data object containing the image data.
24 | @param scale The scale factor to assume when interpreting the image data. Applying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the `size` property.
25 | @param options A dictionary containing any animation decoding options.
26 | @return An initialized object
27 | */
28 | - (nullable instancetype)initWithData:(nonnull NSData *)data scale:(CGFloat)scale options:(nullable SDImageCoderOptions *)options;
29 |
30 | /**
31 | Initializes the image with an animated coder. You can use the coder to decode the image frame later.
32 | @note We use this with animated coder which conforms to `SDProgressiveImageCoder` for progressive animation decoding.
33 |
34 | @param animatedCoder An animated coder which conform `SDAnimatedImageCoder` protocol
35 | @param scale The scale factor to assume when interpreting the image data. Applying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the `size` property.
36 | @return An initialized object
37 | */
38 | - (nullable instancetype)initWithAnimatedCoder:(nonnull id)animatedCoder scale:(CGFloat)scale;
39 |
40 | @optional
41 | // These methods are used for optional advanced feature, like image frame preloading.
42 | /**
43 | Pre-load all animated image frame into memory. Then later frame image request can directly return the frame for index without decoding.
44 | This method may be called on background thread.
45 |
46 | @note If one image instance is shared by lots of imageViews, the CPU performance for large animated image will drop down because the request frame index will be random (not in order) and the decoder should take extra effort to keep it re-entrant. You can use this to reduce CPU usage if need. Attention this will consume more memory usage.
47 | */
48 | - (void)preloadAllFrames;
49 |
50 | /**
51 | Unload all animated image frame from memory if are already pre-loaded. Then later frame image request need decoding. You can use this to free up the memory usage if need.
52 | */
53 | - (void)unloadAllFrames;
54 |
55 | /**
56 | Returns a Boolean value indicating whether all animated image frames are already pre-loaded into memory.
57 | */
58 | @property (nonatomic, assign, readonly, getter=isAllFramesLoaded) BOOL allFramesLoaded;
59 |
60 | @end
61 |
62 | /**
63 | The image class which supports animating on `SDAnimatedImageView`. You can also use it on normal UIImageView/NSImageView.
64 | */
65 | @interface SDAnimatedImage : UIImage
66 |
67 | // This class override these methods from UIImage(NSImage), and it supports NSSecureCoding.
68 | // You should use these methods to create a new animated image. Use other methods just call super instead.
69 | + (nullable instancetype)imageNamed:(nonnull NSString *)name; // Cache in memory, no Asset Catalog support
70 | #if __has_include()
71 | + (nullable instancetype)imageNamed:(nonnull NSString *)name inBundle:(nullable NSBundle *)bundle compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection; // Cache in memory, no Asset Catalog support
72 | #else
73 | + (nullable instancetype)imageNamed:(nonnull NSString *)name inBundle:(nullable NSBundle *)bundle; // Cache in memory, no Asset Catalog support
74 | #endif
75 | + (nullable instancetype)imageWithContentsOfFile:(nonnull NSString *)path;
76 | + (nullable instancetype)imageWithData:(nonnull NSData *)data;
77 | + (nullable instancetype)imageWithData:(nonnull NSData *)data scale:(CGFloat)scale;
78 | - (nullable instancetype)initWithContentsOfFile:(nonnull NSString *)path;
79 | - (nullable instancetype)initWithData:(nonnull NSData *)data;
80 | - (nullable instancetype)initWithData:(nonnull NSData *)data scale:(CGFloat)scale;
81 |
82 | /**
83 | Current animated image format.
84 | */
85 | @property (nonatomic, assign, readonly) SDImageFormat animatedImageFormat;
86 |
87 | /**
88 | Current animated image data, you can use this instead of CGImage to create another instance.
89 | If the current image is not animated image, this value is nil.
90 | */
91 | @property (nonatomic, copy, readonly, nullable) NSData *animatedImageData;
92 |
93 | /**
94 | The scale factor of the image.
95 |
96 | @note For UIKit, this just call super instead.
97 | @note For AppKit, `NSImage` can contains multiple image representations with different scales. However, this class does not do that from the design. We processs the scale like UIKit. This wil actually be calculated from image size and pixel size.
98 | */
99 | @property (nonatomic, readonly) CGFloat scale;
100 |
101 | // By default, animated image frames are returned by decoding just in time without keeping into memory. But you can choose to preload them into memory as well, See the decsription in `SDAnimatedImage` protocol.
102 | // After preloaded, there is no huge difference on performance between this and UIImage's `animatedImageWithImages:duration:`. But UIImage's animation have some issues such like blanking and pausing during segue when using in `UIImageView`. It's recommend to use only if need.
103 | - (void)preloadAllFrames;
104 | - (void)unloadAllFrames;
105 | @property (nonatomic, assign, readonly, getter=isAllFramesLoaded) BOOL allFramesLoaded;
106 |
107 | @end
108 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCacheDefine.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 | #import "SDWebImageDefine.h"
13 |
14 | /// Image Cache Type
15 | typedef NS_ENUM(NSInteger, SDImageCacheType) {
16 | /**
17 | * For query and contains op in response, means the image isn't available in the image cache
18 | * For op in request, this type is not available and take no effect.
19 | */
20 | SDImageCacheTypeNone,
21 | /**
22 | * For query and contains op in response, means the image was obtained from the disk cache.
23 | * For op in request, means process only disk cache.
24 | */
25 | SDImageCacheTypeDisk,
26 | /**
27 | * For query and contains op in response, means the image was obtained from the memory cache.
28 | * For op in request, means process only memory cache.
29 | */
30 | SDImageCacheTypeMemory,
31 | /**
32 | * For query and contains op in response, this type is not available and take no effect.
33 | * For op in request, means process both memory cache and disk cache.
34 | */
35 | SDImageCacheTypeAll
36 | };
37 |
38 | typedef void(^SDImageCacheCheckCompletionBlock)(BOOL isInCache);
39 | typedef void(^SDImageCacheCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize);
40 | typedef NSString * _Nullable (^SDImageCacheAdditionalCachePathBlock)(NSString * _Nonnull key);
41 | typedef void(^SDImageCacheQueryCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType);
42 | typedef void(^SDImageCacheContainsCompletionBlock)(SDImageCacheType containsCacheType);
43 |
44 | /**
45 | This is the built-in decoding process for image query from cache.
46 | @note If you want to implement your custom loader with `queryImageForKey:options:context:completion:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
47 |
48 | @param imageData The image data from the cache. Should not be nil
49 | @param cacheKey The image cache key from the input. Should not be nil
50 | @param options The options arg from the input
51 | @param context The context arg from the input
52 | @return The decoded image for current image data query from cache
53 | */
54 | FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonnull imageData, NSString * _Nonnull cacheKey, SDWebImageOptions options, SDWebImageContext * _Nullable context);
55 |
56 | /**
57 | This is the image cache protocol to provide custom image cache for `SDWebImageManager`.
58 | Though the best practice to custom image cache, is to write your own class which conform `SDMemoryCache` or `SDDiskCache` protocol for `SDImageCache` class (See more on `SDImageCacheConfig.memoryCacheClass & SDImageCacheConfig.diskCacheClass`).
59 | However, if your own cache implementation contains more advanced feature beyond `SDImageCache` itself, you can consider to provide this instead. For example, you can even use a cache manager like `SDImageCachesManager` to register multiple caches.
60 | */
61 | @protocol SDImageCache
62 |
63 | @required
64 | /**
65 | Query the cached image from image cache for given key. The operation can be used to cancel the query.
66 | If image is cached in memory, completion is called synchronously, else aynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
67 |
68 | @param key The image cache key
69 | @param options A mask to specify options to use for this query
70 | @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
71 | @param completionBlock The completion block. Will not get called if the operation is cancelled
72 | @return The operation for this query
73 | */
74 | - (nullable id)queryImageForKey:(nullable NSString *)key
75 | options:(SDWebImageOptions)options
76 | context:(nullable SDWebImageContext *)context
77 | completion:(nullable SDImageCacheQueryCompletionBlock)completionBlock;
78 |
79 | /**
80 | Store the image into image cache for the given key. If cache type is memory only, completion is called synchronously, else aynchronously.
81 |
82 | @param image The image to store
83 | @param imageData The image data to be used for disk storage
84 | @param key The image cache key
85 | @param cacheType The image store op cache type
86 | @param completionBlock A block executed after the operation is finished
87 | */
88 | - (void)storeImage:(nullable UIImage *)image
89 | imageData:(nullable NSData *)imageData
90 | forKey:(nullable NSString *)key
91 | cacheType:(SDImageCacheType)cacheType
92 | completion:(nullable SDWebImageNoParamsBlock)completionBlock;
93 |
94 | /**
95 | Remove the image from image cache for the given key. If cache type is memory only, completion is called synchronously, else aynchronously.
96 |
97 | @param key The image cache key
98 | @param cacheType The image remove op cache type
99 | @param completionBlock A block executed after the operation is finished
100 | */
101 | - (void)removeImageForKey:(nullable NSString *)key
102 | cacheType:(SDImageCacheType)cacheType
103 | completion:(nullable SDWebImageNoParamsBlock)completionBlock;
104 |
105 | /**
106 | Check if image cache contains the image for the given key (does not load the image). If image is cached in memory, completion is called synchronously, else aynchronously.
107 |
108 | @param key The image cache key
109 | @param cacheType The image contains op cache type
110 | @param completionBlock A block executed after the operation is finished.
111 | */
112 | - (void)containsImageForKey:(nullable NSString *)key
113 | cacheType:(SDImageCacheType)cacheType
114 | completion:(nullable SDImageCacheContainsCompletionBlock)completionBlock;
115 |
116 | /**
117 | Clear all the cached images for image cache. If cache type is memory only, completion is called synchronously, else aynchronously.
118 |
119 | @param cacheType The image clear op cache type
120 | @param completionBlock A block executed after the operation is finished
121 | */
122 | - (void)clearWithCacheType:(SDImageCacheType)cacheType
123 | completion:(nullable SDWebImageNoParamsBlock)completionBlock;
124 |
125 | @end
126 |
--------------------------------------------------------------------------------
/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 | /**
15 | A token represents a list of URLs, can be used to cancel the download.
16 | */
17 | @interface SDWebImagePrefetchToken : NSObject
18 |
19 | /**
20 | * Cancel the current prefetching.
21 | */
22 | - (void)cancel;
23 |
24 | /**
25 | list of URLs of current prefetching.
26 | */
27 | @property (nonatomic, copy, readonly, nullable) NSArray *urls;
28 |
29 | @end
30 |
31 | /**
32 | The prefetcher delegate protocol
33 | */
34 | @protocol SDWebImagePrefetcherDelegate
35 |
36 | @optional
37 |
38 | /**
39 | * Called when an image was prefetched. Which means it's called when one URL from any of prefetching finished.
40 | *
41 | * @param imagePrefetcher The current image prefetcher
42 | * @param imageURL The image url that was prefetched
43 | * @param finishedCount The total number of images that were prefetched (successful or not)
44 | * @param totalCount The total number of images that were to be prefetched
45 | */
46 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount;
47 |
48 | /**
49 | * Called when all images are prefetched. Which means it's called when all URLs from all of prefetching finished.
50 | * @param imagePrefetcher The current image prefetcher
51 | * @param totalCount The total number of images that were prefetched (whether successful or not)
52 | * @param skippedCount The total number of images that were skipped
53 | */
54 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount;
55 |
56 | @end
57 |
58 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls);
59 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls);
60 |
61 | /**
62 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority.
63 | */
64 | @interface SDWebImagePrefetcher : NSObject
65 |
66 | /**
67 | * The web image manager used by prefetcher to prefetch images.
68 | * @note You can specify a standalone manager and downloader with custom configuration suitable for image prefetching. Such as `currentDownloadCount` or `downloadTimeout`.
69 | */
70 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager;
71 |
72 | /**
73 | * Maximum number of URLs to prefetch at the same time. Defaults to 3.
74 | */
75 | @property (nonatomic, assign) NSUInteger maxConcurrentPrefetchCount;
76 |
77 | /**
78 | * The options for prefetcher. Defaults to SDWebImageLowPriority.
79 | */
80 | @property (nonatomic, assign) SDWebImageOptions options;
81 |
82 | /**
83 | * The context for prefetcher. Defaults to nil.
84 | */
85 | @property (nonatomic, copy, nullable) SDWebImageContext *context;
86 |
87 | /**
88 | * Queue options for prefetcher when call the progressBlock, completionBlock and delegate methods. Defaults to Main Queue.
89 | * @note The call is asynchronously to avoid blocking target queue.
90 | * @note The delegate queue should be set before any prefetching start and may not be changed during prefetching to avoid thread-safe problem.
91 | */
92 | @property (strong, nonatomic, nonnull) dispatch_queue_t delegateQueue;
93 |
94 | /**
95 | * The delegate for the prefetcher. Defatuls to nil.
96 | */
97 | @property (weak, nonatomic, nullable) id delegate;
98 |
99 | /**
100 | * Returns the global shared image prefetcher instance. It use a standalone manager which is different from shared manager.
101 | */
102 | @property (nonatomic, class, readonly, nonnull) SDWebImagePrefetcher *sharedImagePrefetcher;
103 |
104 | /**
105 | * Allows you to instantiate a prefetcher with any arbitrary image manager.
106 | */
107 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER;
108 |
109 | /**
110 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
111 | * Prefetching is seperate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
112 | * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
113 | *
114 | * @param urls list of URLs to prefetch
115 | * @return the token to cancel the current prefetching.
116 | */
117 | - (nullable SDWebImagePrefetchToken *)prefetchURLs:(nullable NSArray *)urls;
118 |
119 | /**
120 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
121 | * Prefetching is seperate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
122 | * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
123 | *
124 | * @param urls list of URLs to prefetch
125 | * @param progressBlock block to be called when progress updates;
126 | * first parameter is the number of completed (successful or not) requests,
127 | * second parameter is the total number of images originally requested to be prefetched
128 | * @param completionBlock block to be called when the current prefetching is completed
129 | * first param is the number of completed (successful or not) requests,
130 | * second parameter is the number of skipped requests
131 | * @return the token to cancel the current prefetching.
132 | */
133 | - (nullable SDWebImagePrefetchToken *)prefetchURLs:(nullable NSArray *)urls
134 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock
135 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock;
136 |
137 | /**
138 | * Remove and cancel all the prefeching for the prefetcher.
139 | */
140 | - (void)cancelPrefetching;
141 |
142 |
143 | @end
144 |
--------------------------------------------------------------------------------
/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 | /**
14 | Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol
15 | For the description about these methods, see `SDWebImageDownloaderOperation`
16 | @note If your custom operation class does not use `NSURLSession` at all, do not implement the optional methods and session delegate methods.
17 | */
18 | @protocol SDWebImageDownloaderOperation
19 | @required
20 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
21 | inSession:(nullable NSURLSession *)session
22 | options:(SDWebImageDownloaderOptions)options;
23 |
24 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
25 | inSession:(nullable NSURLSession *)session
26 | options:(SDWebImageDownloaderOptions)options
27 | context:(nullable SDWebImageContext *)context;
28 |
29 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
30 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
31 |
32 | - (BOOL)cancel:(nullable id)token;
33 |
34 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request;
35 | @property (strong, nonatomic, readonly, nullable) NSURLResponse *response;
36 |
37 | @optional
38 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask;
39 | @property (strong, nonatomic, nullable) NSURLCredential *credential;
40 | @property (assign, nonatomic) double minimumProgressInterval;
41 |
42 | @end
43 |
44 |
45 | /**
46 | The download operation class for SDWebImageDownloader.
47 | */
48 | @interface SDWebImageDownloaderOperation : NSOperation
49 |
50 | /**
51 | * The request used by the operation's task.
52 | */
53 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request;
54 |
55 | /**
56 | * The response returned by the operation's task.
57 | */
58 | @property (strong, nonatomic, readonly, nullable) NSURLResponse *response;
59 |
60 | /**
61 | * The operation's task
62 | */
63 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask;
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 (strong, nonatomic, nullable) NSURLCredential *credential;
71 |
72 | /**
73 | * The minimum interval about progress percent during network downloading. Which means the next progress callback and current progress callback's progress percent difference should be larger or equal to this value. However, the final finish download progress callback does not get effected.
74 | * The value should be 0.0-1.0.
75 | * @note If you're using progressive decoding feature, this will also effect the image refresh rate.
76 | * @note This value may enhance the performance if you don't want progress callback too frequently.
77 | * Defaults to 0, which means each time we receive the new data from URLSession, we callback the progressBlock immediately.
78 | */
79 | @property (assign, nonatomic) double minimumProgressInterval;
80 |
81 | /**
82 | * The options for the receiver.
83 | */
84 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
85 |
86 | /**
87 | * The context for the receiver.
88 | */
89 | @property (copy, nonatomic, readonly, nullable) SDWebImageContext *context;
90 |
91 | /**
92 | * Initializes a `SDWebImageDownloaderOperation` object
93 | *
94 | * @see SDWebImageDownloaderOperation
95 | *
96 | * @param request the URL request
97 | * @param session the URL session in which this operation will run
98 | * @param options downloader options
99 | *
100 | * @return the initialized instance
101 | */
102 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
103 | inSession:(nullable NSURLSession *)session
104 | options:(SDWebImageDownloaderOptions)options;
105 |
106 | /**
107 | * Initializes a `SDWebImageDownloaderOperation` object
108 | *
109 | * @see SDWebImageDownloaderOperation
110 | *
111 | * @param request the URL request
112 | * @param session the URL session in which this operation will run
113 | * @param options downloader options
114 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
115 | *
116 | * @return the initialized instance
117 | */
118 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
119 | inSession:(nullable NSURLSession *)session
120 | options:(SDWebImageDownloaderOptions)options
121 | context:(nullable SDWebImageContext *)context NS_DESIGNATED_INITIALIZER;
122 |
123 | /**
124 | * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of
125 | * callbacks.
126 | *
127 | * @param progressBlock the block executed when a new chunk of data arrives.
128 | * @note the progress block is executed on a background queue
129 | * @param completedBlock the block executed when the download is done.
130 | * @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
131 | *
132 | * @return the token to use to cancel this set of handlers
133 | */
134 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
135 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
136 |
137 | /**
138 | * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled.
139 | *
140 | * @param token the token representing a set of callbacks to cancel
141 | *
142 | * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise.
143 | */
144 | - (BOOL)cancel:(nullable id)token;
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/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`, custom options and context.
42 | *
43 | * The download is asynchronous and cached.
44 | *
45 | * @param url The url for the image.
46 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
47 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
48 | */
49 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
50 | options:(SDWebImageOptions)options
51 | context:(nullable SDWebImageContext *)context;
52 |
53 | /**
54 | * Set the imageView `highlightedImage` with an `url`.
55 | *
56 | * The download is asynchronous and cached.
57 | *
58 | * @param url The url for the image.
59 | * @param completedBlock A block called when operation has been completed. This block has no return value
60 | * and takes the requested UIImage as first parameter. In case of error the image parameter
61 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
62 | * indicating if the image was retrieved from the local cache or from the network.
63 | * The fourth parameter is the original image url.
64 | */
65 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
66 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
67 |
68 | /**
69 | * Set the imageView `highlightedImage` with an `url` and custom options.
70 | *
71 | * The download is asynchronous and cached.
72 | *
73 | * @param url The url for the image.
74 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
75 | * @param completedBlock A block called when operation has been completed. This block has no return value
76 | * and takes the requested UIImage as first parameter. In case of error the image parameter
77 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
78 | * indicating if the image was retrieved from the local cache or from the network.
79 | * The fourth parameter is the original image url.
80 | */
81 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
82 | options:(SDWebImageOptions)options
83 | completed:(nullable SDExternalCompletionBlock)completedBlock;
84 |
85 | /**
86 | * Set the imageView `highlightedImage` with an `url` and custom options.
87 | *
88 | * The download is asynchronous and cached.
89 | *
90 | * @param url The url for the image.
91 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
92 | * @param progressBlock A block called while image is downloading
93 | * @note the progress block is executed on a background queue
94 | * @param completedBlock A block called when operation has been completed. This block has no return value
95 | * and takes the requested UIImage as first parameter. In case of error the image parameter
96 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
97 | * indicating if the image was retrieved from the local cache or from the network.
98 | * The fourth parameter is the original image url.
99 | */
100 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
101 | options:(SDWebImageOptions)options
102 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
103 | completed:(nullable SDExternalCompletionBlock)completedBlock;
104 |
105 | /**
106 | * Set the imageView `highlightedImage` with an `url`, custom options and context.
107 | *
108 | * The download is asynchronous and cached.
109 | *
110 | * @param url The url for the image.
111 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
112 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
113 | * @param progressBlock A block called while image is downloading
114 | * @note the progress block is executed on a background queue
115 | * @param completedBlock A block called when operation has been completed. This block has no return value
116 | * and takes the requested UIImage as first parameter. In case of error the image parameter
117 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
118 | * indicating if the image was retrieved from the local cache or from the network.
119 | * The fourth parameter is the original image url.
120 | */
121 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
122 | options:(SDWebImageOptions)options
123 | context:(nullable SDWebImageContext *)context
124 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
125 | completed:(nullable SDExternalCompletionBlock)completedBlock;
126 |
127 | @end
128 |
129 | #endif
130 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageLoader.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 "SDWebImageDefine.h"
11 | #import "SDWebImageOperation.h"
12 |
13 | typedef void(^SDImageLoaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL);
14 | typedef void(^SDImageLoaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished);
15 |
16 | #pragma mark - Context Options
17 |
18 | /**
19 | A `UIImage` instance from `SDWebImageManager` when you specify `SDWebImageRefreshCached` and image cache hit.
20 | This can be a hint for image loader to load the image from network and refresh the image from remote location if needed. If the image from remote location does not change, you should call the completion with `SDWebImageErrorCacheNotModified` error. (UIImage)
21 | @note If you don't implement `SDWebImageRefreshCached` support, you do not need to care abot this context option.
22 | */
23 | FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLoaderCachedImage;
24 |
25 | #pragma mark - Helper method
26 |
27 | /**
28 | This is the built-in decoding process for image download from network or local file.
29 | @note If you want to implement your custom loader with `requestImageWithURL:options:context:progress:completed:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
30 |
31 | @param imageData The image data from the network. Should not be nil
32 | @param imageURL The image URL from the input. Should not be nil
33 | @param options The options arg from the input
34 | @param context The context arg from the input
35 | @return The decoded image for current image data load from the network
36 | */
37 | FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context);
38 |
39 | /**
40 | This is the built-in decoding process for image progressive download from network. It's used when `SDWebImageProgressiveLoad` option is set. (It's not required when your loader does not support progressive image loading)
41 | @note If you want to implement your custom loader with `requestImageWithURL:options:context:progress:completed:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
42 |
43 | @param imageData The image data from the network so far. Should not be nil
44 | @param imageURL The image URL from the input. Should not be nil
45 | @param finished Pass NO to specify the download process has not finished. Pass YES when all image data has finished.
46 | @param operation The loader operation associated with current progressive download. Why to provide this is because progressive decoding need to store the partial decoded context for each operation to avoid conflict. You should provide the operation from `loadImageWithURL:` method return value.
47 | @param options The options arg from the input
48 | @param context The context arg from the input
49 | @return The decoded progressive image for current image data load from the network
50 | */
51 | FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context);
52 |
53 | #pragma mark - SDImageLoader
54 |
55 | /**
56 | This is the protocol to specify custom image load process. You can create your own class to conform this protocol and use as a image loader to load image from network or any avaiable remote resources defined by yourself.
57 | If you want to implement custom loader for image download from network or local file, you just need to concentrate on image data download only. After the download finish, call `SDImageLoaderDecodeImageData` or `SDImageLoaderDecodeProgressiveImageData` to use the built-in decoding process and produce image (Remember to call in the global queue). And finally callback the completion block.
58 | If you directlly get the image instance using some third-party SDKs, such as image directlly from Photos framework. You can process the image data and image instance by yourself without that built-in decoding process. And finally callback the completion block.
59 | @note It's your responsibility to load the image in the desired global queue(to avoid block main queue). We do not dispatch these method call in a global queue but just from the call queue (For `SDWebImageManager`, it typically call from the main queue).
60 | */
61 | @protocol SDImageLoader
62 |
63 | /**
64 | Whether current image loader supports to load the provide image URL.
65 | This will be checked everytime a new image request come for loader. If this return NO, we will mark this image load as failed. If return YES, we will start to call `requestImageWithURL:options:context:progress:completed:`.
66 |
67 | @param url The image URL to be loaded.
68 | @return YES to continue download, NO to stop download.
69 | */
70 | - (BOOL)canRequestImageForURL:(nullable NSURL *)url;
71 |
72 | /**
73 | Load the image and image data with the given URL and return the image data. You're responsible for producing the image instance.
74 |
75 | @param url The URL represent the image. Note this may not be a HTTP URL
76 | @param options A mask to specify options to use for this request
77 | @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
78 | @param progressBlock A block called while image is downloading
79 | * @note the progress block is executed on a background queue
80 | @param completedBlock A block called when operation has been completed.
81 | @return An operation which allow the user to cancel the current request.
82 | */
83 | - (nullable id)requestImageWithURL:(nullable NSURL *)url
84 | options:(SDWebImageOptions)options
85 | context:(nullable SDWebImageContext *)context
86 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
87 | completed:(nullable SDImageLoaderCompletedBlock)completedBlock;
88 |
89 |
90 | /**
91 | Whether the error from image loader should be marked indded un-recoverable or not.
92 | If this return YES, failed URL which does not using `SDWebImageRetryFailed` will be blocked into black list. Else not.
93 |
94 | @param url The URL represent the image. Note this may not be a HTTP URL
95 | @param error The URL's loading error, from previous `requestImageWithURL:options:context:progress:completed:` completedBlock's error.
96 | @return Whether to block this url or not. Return YES to mark this URL as failed.
97 | */
98 | - (BOOL)shouldBlockFailedURLWithURL:(nonnull NSURL *)url
99 | error:(nonnull NSError *)error;
100 |
101 | @end
102 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageTransformer.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 "UIImage+Transform.h"
11 |
12 | /**
13 | Return the transformed cache key which applied with specify transformerKey.
14 |
15 | @param key The original cache key
16 | @param transformerKey The transformer key from the transformer
17 | @return The transformed cache key
18 | */
19 | FOUNDATION_EXPORT NSString * _Nullable SDTransformedKeyForKey(NSString * _Nullable key, NSString * _Nonnull transformerKey);
20 |
21 | /**
22 | A transformer protocol to transform the image load from cache or from download.
23 | You can provide transformer to cache and manager (Through the `transformer` property or context option `SDWebImageContextImageTransformer`).
24 |
25 | @note The transform process is called from a global queue in order to not to block the main queue.
26 | */
27 | @protocol SDImageTransformer
28 |
29 | @required
30 | /**
31 | For each transformer, it must contains its cache key to used to store the image cache or query from the cache. This key will be appened after the original cache key generated by URL or from user.
32 |
33 | @return The cache key to appended after the original cache key. Should not be nil.
34 | */
35 | @property (nonatomic, copy, readonly, nonnull) NSString *transformerKey;
36 |
37 | /**
38 | Transform the image to another image.
39 |
40 | @param image The image to be transformed
41 | @param key The cache key associated to the image
42 | @return The transformed image, or nil if transform failed
43 | */
44 | - (nullable UIImage *)transformedImageWithImage:(nonnull UIImage *)image forKey:(nonnull NSString *)key;
45 |
46 | @end
47 |
48 | #pragma mark - Pipeline
49 |
50 | /**
51 | Pipeline transformer. Which you can bind multiple transformers together to let the image to be transformed one by one in order and generate the final image.
52 | @note Because transformers are lightweight, if you want to append or arrange transfomers, create another pipeline transformer instead. This class is considered as immutable.
53 | */
54 | @interface SDImagePipelineTransformer : NSObject
55 |
56 | /**
57 | All transformers in pipeline
58 | */
59 | @property (nonatomic, copy, readonly, nonnull) NSArray> *transformers;
60 |
61 | - (nonnull instancetype)init NS_UNAVAILABLE;
62 | + (nonnull instancetype)transformerWithTransformers:(nonnull NSArray> *)transformers;
63 |
64 | @end
65 |
66 | // There are some built-in transformers based on the `UIImage+Transformer` category to provide the common image geometry, image blending and image effect process. Those transform are useful for static image only but you can create your own to support animated image as well.
67 | // Because transformers are lightweight, these class are considered as immutable.
68 | #pragma mark - Image Geometry
69 |
70 | /**
71 | Image round corner transformer
72 | */
73 | @interface SDImageRoundCornerTransformer: NSObject
74 |
75 | /**
76 | The radius of each corner oval. Values larger than half the
77 | rectangle's width or height are clamped appropriately to
78 | half the width or height.
79 | */
80 | @property (nonatomic, assign, readonly) CGFloat cornerRadius;
81 |
82 | /**
83 | A bitmask value that identifies the corners that you want
84 | rounded. You can use this parameter to round only a subset
85 | of the corners of the rectangle.
86 | */
87 | @property (nonatomic, assign, readonly) SDRectCorner corners;
88 |
89 | /**
90 | The inset border line width. Values larger than half the rectangle's
91 | width or height are clamped appropriately to half the width
92 | or height.
93 | */
94 | @property (nonatomic, assign, readonly) CGFloat borderWidth;
95 |
96 | /**
97 | The border stroke color. nil means clear color.
98 | */
99 | @property (nonatomic, strong, readonly, nullable) UIColor *borderColor;
100 |
101 | - (nonnull instancetype)init NS_UNAVAILABLE;
102 | + (nonnull instancetype)transformerWithRadius:(CGFloat)cornerRadius corners:(SDRectCorner)corners borderWidth:(CGFloat)borderWidth borderColor:(nullable UIColor *)borderColor;
103 |
104 | @end
105 |
106 | /**
107 | Image resizing transformer
108 | */
109 | @interface SDImageResizingTransformer : NSObject
110 |
111 | /**
112 | The new size to be resized, values should be positive.
113 | */
114 | @property (nonatomic, assign, readonly) CGSize size;
115 |
116 | /**
117 | The scale mode for image content.
118 | */
119 | @property (nonatomic, assign, readonly) SDImageScaleMode scaleMode;
120 |
121 | - (nonnull instancetype)init NS_UNAVAILABLE;
122 | + (nonnull instancetype)transformerWithSize:(CGSize)size scaleMode:(SDImageScaleMode)scaleMode;
123 |
124 | @end
125 |
126 | /**
127 | Image cropping transformer
128 | */
129 | @interface SDImageCroppingTransformer : NSObject
130 |
131 | /**
132 | Image's inner rect.
133 | */
134 | @property (nonatomic, assign, readonly) CGRect rect;
135 |
136 | - (nonnull instancetype)init NS_UNAVAILABLE;
137 | + (nonnull instancetype)transformerWithRect:(CGRect)rect;
138 |
139 | @end
140 |
141 | /**
142 | Image flipping transformer
143 | */
144 | @interface SDImageFlippingTransformer : NSObject
145 |
146 | /**
147 | YES to flip the image horizontally. ⇋
148 | */
149 | @property (nonatomic, assign, readonly) BOOL horizontal;
150 |
151 | /**
152 | YES to flip the image vertically. ⥯
153 | */
154 | @property (nonatomic, assign, readonly) BOOL vertical;
155 |
156 | - (nonnull instancetype)init NS_UNAVAILABLE;
157 | + (nonnull instancetype)transformerWithHorizontal:(BOOL)horizontal vertical:(BOOL)vertical;
158 |
159 | @end
160 |
161 | /**
162 | Image rotation transformer
163 | */
164 | @interface SDImageRotationTransformer : NSObject
165 |
166 | /**
167 | Rotated radians in counterclockwise.⟲
168 | */
169 | @property (nonatomic, assign, readonly) CGFloat angle;
170 |
171 | /**
172 | YES: new image's size is extend to fit all content.
173 | NO: image's size will not change, content may be clipped.
174 | */
175 | @property (nonatomic, assign, readonly) BOOL fitSize;
176 |
177 | - (nonnull instancetype)init NS_UNAVAILABLE;
178 | + (nonnull instancetype)transformerWithAngle:(CGFloat)angle fitSize:(BOOL)fitSize;
179 |
180 | @end
181 |
182 | #pragma mark - Image Blending
183 |
184 | /**
185 | Image tint color transformer
186 | */
187 | @interface SDImageTintTransformer : NSObject
188 |
189 | /**
190 | The tint color.
191 | */
192 | @property (nonatomic, strong, readonly, nonnull) UIColor *tintColor;
193 |
194 | - (nonnull instancetype)init NS_UNAVAILABLE;
195 | + (nonnull instancetype)transformerWithColor:(nonnull UIColor *)tintColor;
196 |
197 | @end
198 |
199 | #pragma mark - Image Effect
200 |
201 | /**
202 | Image blur effect transformer
203 | */
204 | @interface SDImageBlurTransformer : NSObject
205 |
206 | /**
207 | The radius of the blur in points, 0 means no blur effect.
208 | */
209 | @property (nonatomic, assign, readonly) CGFloat blurRadius;
210 |
211 | - (nonnull instancetype)init NS_UNAVAILABLE;
212 | + (nonnull instancetype)transformerWithRadius:(CGFloat)blurRadius;
213 |
214 | @end
215 |
216 | #if SD_UIKIT || SD_MAC
217 | /**
218 | Core Image filter transformer
219 | */
220 | @interface SDImageFilterTransformer: NSObject
221 |
222 | /**
223 | The CIFilter to be applied to the image.
224 | */
225 | @property (nonatomic, strong, readonly, nonnull) CIFilter *filter;
226 |
227 | - (nonnull instancetype)init NS_UNAVAILABLE;
228 | + (nonnull instancetype)transformerWithFilter:(nonnull CIFilter *)filter;
229 |
230 | @end
231 | #endif
232 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDAnimatedImageView+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 "SDAnimatedImageView.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | /**
16 | Integrates SDWebImage async downloading and caching of remote images with SDAnimatedImageView.
17 | */
18 | @interface SDAnimatedImageView (WebCache)
19 |
20 | /**
21 | * Set the imageView `image` with an `url`.
22 | *
23 | * The download is asynchronous and cached.
24 | *
25 | * @param url The url for the image.
26 | */
27 | - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
28 |
29 | /**
30 | * Set the imageView `image` with an `url` and a placeholder.
31 | *
32 | * The download is asynchronous and cached.
33 | *
34 | * @param url The url for the image.
35 | * @param placeholder The image to be set initially, until the image request finishes.
36 | * @see sd_setImageWithURL:placeholderImage:options:
37 | */
38 | - (void)sd_setImageWithURL:(nullable NSURL *)url
39 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
40 |
41 | /**
42 | * Set the imageView `image` with an `url`, placeholder and custom options.
43 | *
44 | * The download is asynchronous and cached.
45 | *
46 | * @param url The url for the image.
47 | * @param placeholder The image to be set initially, until the image request finishes.
48 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
49 | */
50 | - (void)sd_setImageWithURL:(nullable NSURL *)url
51 | placeholderImage:(nullable UIImage *)placeholder
52 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
53 |
54 | /**
55 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
56 | *
57 | * The download is asynchronous and cached.
58 | *
59 | * @param url The url for the image.
60 | * @param placeholder The image to be set initially, until the image request finishes.
61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
62 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
63 | */
64 | - (void)sd_setImageWithURL:(nullable NSURL *)url
65 | placeholderImage:(nullable UIImage *)placeholder
66 | options:(SDWebImageOptions)options
67 | context:(nullable SDWebImageContext *)context;
68 |
69 | /**
70 | * Set the imageView `image` with an `url`.
71 | *
72 | * The download is asynchronous and cached.
73 | *
74 | * @param url The url for the image.
75 | * @param completedBlock A block called when operation has been completed. This block has no return value
76 | * and takes the requested UIImage as first parameter. In case of error the image parameter
77 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
78 | * indicating if the image was retrieved from the local cache or from the network.
79 | * The fourth parameter is the original image url.
80 | */
81 | - (void)sd_setImageWithURL:(nullable NSURL *)url
82 | completed:(nullable SDExternalCompletionBlock)completedBlock;
83 |
84 | /**
85 | * Set the imageView `image` with an `url`, placeholder.
86 | *
87 | * The download is asynchronous and cached.
88 | *
89 | * @param url The url for the image.
90 | * @param placeholder The image to be set initially, until the image request finishes.
91 | * @param completedBlock A block called when operation has been completed. This block has no return value
92 | * and takes the requested UIImage as first parameter. In case of error the image parameter
93 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
94 | * indicating if the image was retrieved from the local cache or from the network.
95 | * The fourth parameter is the original image url.
96 | */
97 | - (void)sd_setImageWithURL:(nullable NSURL *)url
98 | placeholderImage:(nullable UIImage *)placeholder
99 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
100 |
101 | /**
102 | * Set the imageView `image` with an `url`, placeholder and custom options.
103 | *
104 | * The download is asynchronous and cached.
105 | *
106 | * @param url The url for the image.
107 | * @param placeholder The image to be set initially, until the image request finishes.
108 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
109 | * @param completedBlock A block called when operation has been completed. This block has no return value
110 | * and takes the requested UIImage as first parameter. In case of error the image parameter
111 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
112 | * indicating if the image was retrieved from the local cache or from the network.
113 | * The fourth parameter is the original image url.
114 | */
115 | - (void)sd_setImageWithURL:(nullable NSURL *)url
116 | placeholderImage:(nullable UIImage *)placeholder
117 | options:(SDWebImageOptions)options
118 | completed:(nullable SDExternalCompletionBlock)completedBlock;
119 |
120 | /**
121 | * Set the imageView `image` with an `url`, placeholder and custom options.
122 | *
123 | * The download is asynchronous and cached.
124 | *
125 | * @param url The url for the image.
126 | * @param placeholder The image to be set initially, until the image request finishes.
127 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
128 | * @param progressBlock A block called while image is downloading
129 | * @note the progress block is executed on a background queue
130 | * @param completedBlock A block called when operation has been completed. This block has no return value
131 | * and takes the requested UIImage as first parameter. In case of error the image parameter
132 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
133 | * indicating if the image was retrieved from the local cache or from the network.
134 | * The fourth parameter is the original image url.
135 | */
136 | - (void)sd_setImageWithURL:(nullable NSURL *)url
137 | placeholderImage:(nullable UIImage *)placeholder
138 | options:(SDWebImageOptions)options
139 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
140 | completed:(nullable SDExternalCompletionBlock)completedBlock;
141 |
142 | /**
143 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
144 | *
145 | * The download is asynchronous and cached.
146 | *
147 | * @param url The url for the image.
148 | * @param placeholder The image to be set initially, until the image request finishes.
149 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
150 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
151 | * @param progressBlock A block called while image is downloading
152 | * @note the progress block is executed on a background queue
153 | * @param completedBlock A block called when operation has been completed. This block has no return value
154 | * and takes the requested UIImage as first parameter. In case of error the image parameter
155 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
156 | * indicating if the image was retrieved from the local cache or from the network.
157 | * The fourth parameter is the original image url.
158 | */
159 | - (void)sd_setImageWithURL:(nullable NSURL *)url
160 | placeholderImage:(nullable UIImage *)placeholder
161 | options:(SDWebImageOptions)options
162 | context:(nullable SDWebImageContext *)context
163 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
164 | completed:(nullable SDExternalCompletionBlock)completedBlock;
165 |
166 | @end
167 |
168 | #endif
169 |
--------------------------------------------------------------------------------
/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 | * Usage with a UITableViewCell sub-class:
14 | *
15 | * @code
16 |
17 | #import
18 |
19 | ...
20 |
21 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
22 | {
23 | static NSString *MyIdentifier = @"MyIdentifier";
24 |
25 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
26 |
27 | if (cell == nil) {
28 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
29 | }
30 |
31 | // Here we use the provided sd_setImageWithURL:placeholderImage: method to load the web image
32 | // Ensure you use a placeholder image otherwise cells will be initialized with no image
33 | [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"]
34 | placeholderImage:[UIImage imageNamed:@"placeholder"]];
35 |
36 | cell.textLabel.text = @"My Text";
37 | return cell;
38 | }
39 |
40 | * @endcode
41 | */
42 |
43 | /**
44 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView.
45 | */
46 | @interface UIImageView (WebCache)
47 |
48 | /**
49 | * Set the imageView `image` with an `url`.
50 | *
51 | * The download is asynchronous and cached.
52 | *
53 | * @param url The url for the image.
54 | */
55 | - (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
56 |
57 | /**
58 | * Set the imageView `image` with an `url` and a placeholder.
59 | *
60 | * The download is asynchronous and cached.
61 | *
62 | * @param url The url for the image.
63 | * @param placeholder The image to be set initially, until the image request finishes.
64 | * @see sd_setImageWithURL:placeholderImage:options:
65 | */
66 | - (void)sd_setImageWithURL:(nullable NSURL *)url
67 | placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
68 |
69 | /**
70 | * Set the imageView `image` with an `url`, placeholder and custom options.
71 | *
72 | * The download is asynchronous and cached.
73 | *
74 | * @param url The url for the image.
75 | * @param placeholder The image to be set initially, until the image request finishes.
76 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
77 | */
78 | - (void)sd_setImageWithURL:(nullable NSURL *)url
79 | placeholderImage:(nullable UIImage *)placeholder
80 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
81 |
82 | /**
83 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
84 | *
85 | * The download is asynchronous and cached.
86 | *
87 | * @param url The url for the image.
88 | * @param placeholder The image to be set initially, until the image request finishes.
89 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
90 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
91 | */
92 | - (void)sd_setImageWithURL:(nullable NSURL *)url
93 | placeholderImage:(nullable UIImage *)placeholder
94 | options:(SDWebImageOptions)options
95 | context:(nullable SDWebImageContext *)context;
96 |
97 | /**
98 | * Set the imageView `image` with an `url`.
99 | *
100 | * The download is asynchronous and cached.
101 | *
102 | * @param url The url for the image.
103 | * @param completedBlock A block called when operation has been completed. This block has no return value
104 | * and takes the requested UIImage as first parameter. In case of error the image parameter
105 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
106 | * indicating if the image was retrieved from the local cache or from the network.
107 | * The fourth parameter is the original image url.
108 | */
109 | - (void)sd_setImageWithURL:(nullable NSURL *)url
110 | completed:(nullable SDExternalCompletionBlock)completedBlock;
111 |
112 | /**
113 | * Set the imageView `image` with an `url`, placeholder.
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 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 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
128 |
129 | /**
130 | * Set the imageView `image` with an `url`, placeholder and custom options.
131 | *
132 | * The download is asynchronous and cached.
133 | *
134 | * @param url The url for the image.
135 | * @param placeholder The image to be set initially, until the image request finishes.
136 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
137 | * @param completedBlock A block called when operation has been completed. This block has no return value
138 | * and takes the requested UIImage as first parameter. In case of error the image parameter
139 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
140 | * indicating if the image was retrieved from the local cache or from the network.
141 | * The fourth parameter is the original image url.
142 | */
143 | - (void)sd_setImageWithURL:(nullable NSURL *)url
144 | placeholderImage:(nullable UIImage *)placeholder
145 | options:(SDWebImageOptions)options
146 | completed:(nullable SDExternalCompletionBlock)completedBlock;
147 |
148 | /**
149 | * Set the imageView `image` with an `url`, placeholder and custom options.
150 | *
151 | * The download is asynchronous and cached.
152 | *
153 | * @param url The url for the image.
154 | * @param placeholder The image to be set initially, until the image request finishes.
155 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
156 | * @param progressBlock A block called while image is downloading
157 | * @note the progress block is executed on a background queue
158 | * @param completedBlock A block called when operation has been completed. This block has no return value
159 | * and takes the requested UIImage as first parameter. In case of error the image parameter
160 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
161 | * indicating if the image was retrieved from the local cache or from the network.
162 | * The fourth parameter is the original image url.
163 | */
164 | - (void)sd_setImageWithURL:(nullable NSURL *)url
165 | placeholderImage:(nullable UIImage *)placeholder
166 | options:(SDWebImageOptions)options
167 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
168 | completed:(nullable SDExternalCompletionBlock)completedBlock;
169 |
170 | /**
171 | * Set the imageView `image` with an `url`, placeholder, custom options and context.
172 | *
173 | * The download is asynchronous and cached.
174 | *
175 | * @param url The url for the image.
176 | * @param placeholder The image to be set initially, until the image request finishes.
177 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
178 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
179 | * @param progressBlock A block called while image is downloading
180 | * @note the progress block is executed on a background queue
181 | * @param completedBlock A block called when operation has been completed. This block has no return value
182 | * and takes the requested UIImage as first parameter. In case of error the image parameter
183 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
184 | * indicating if the image was retrieved from the local cache or from the network.
185 | * The fourth parameter is the original image url.
186 | */
187 | - (void)sd_setImageWithURL:(nullable NSURL *)url
188 | placeholderImage:(nullable UIImage *)placeholder
189 | options:(SDWebImageOptions)options
190 | context:(nullable SDWebImageContext *)context
191 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
192 | completed:(nullable SDExternalCompletionBlock)completedBlock;
193 |
194 | @end
195 |
--------------------------------------------------------------------------------
/Carthage/Build/Mac/SDWebImage.framework/Versions/A/Headers/SDImageCoder.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 | typedef NSString * SDImageCoderOption NS_STRING_ENUM;
14 | typedef NSDictionary SDImageCoderOptions;
15 | typedef NSMutableDictionary SDImageCoderMutableOptions;
16 |
17 | #pragma mark - Coder Options
18 | // These options are for image decoding
19 | /**
20 | A Boolean value indicating whether to decode the first frame only for animated image during decoding. (NSNumber). If not provide, decode animated image if need.
21 | @note works for `SDImageCoder`.
22 | */
23 | FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderDecodeFirstFrameOnly;
24 | /**
25 | A CGFloat value which is greater than or equal to 1.0. This value specify the image scale factor for decoding. If not provide, use 1.0. (NSNumber)
26 | @note works for `SDImageCoder`, `SDProgressiveImageCoder`, `SDAnimatedImageCoder`.
27 | */
28 | FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderDecodeScaleFactor;
29 |
30 | // These options are for image encoding
31 | /**
32 | A Boolean value indicating whether to encode the first frame only for animated image during encoding. (NSNumber). If not provide, encode animated image if need.
33 | @note works for `SDImageCoder`.
34 | */
35 | FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeFirstFrameOnly;
36 | /**
37 | A double value between 0.0-1.0 indicating the encode compression quality to produce the image data. 1.0 resulting in no compression and 0.0 resulting in the maximum compression possible. If not provide, use 1.0. (NSNumber)
38 | @note works for `SDImageCoder`
39 | */
40 | FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeCompressionQuality;
41 |
42 | /**
43 | A SDWebImageContext object which hold the original context options from top-level API. (SDWebImageContext)
44 | This option is ignored for all built-in coders and take no effect.
45 | But this may be useful for some custom coders, because some business logic may dependent on things other than image or image data inforamtion only.
46 | See `SDWebImageContext` for more detailed information.
47 | */
48 | FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderWebImageContext;
49 |
50 | #pragma mark - Coder
51 | /**
52 | This is the image coder protocol to provide custom image decoding/encoding.
53 | These methods are all required to implement.
54 | @note Pay attention that these methods are not called from main queue.
55 | */
56 | @protocol SDImageCoder
57 |
58 | @required
59 | #pragma mark - Decoding
60 | /**
61 | Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder.
62 |
63 | @param data The image data so we can look at it
64 | @return YES if this coder can decode the data, NO otherwise
65 | */
66 | - (BOOL)canDecodeFromData:(nullable NSData *)data;
67 |
68 | /**
69 | Decode the image data to image.
70 | @note This protocol may supports decode animated image frames. You can use `+[SDImageCoderHelper animatedImageWithFrames:]` to produce an animated image with frames.
71 |
72 | @param data The image data to be decoded
73 | @param options A dictionary containing any decoding options. Pass @{SDImageCoderDecodeScaleFactor: @(1.0)} to specify scale factor for image. Pass @{SDImageCoderDecodeFirstFrameOnly: @(YES)} to decode the first frame only.
74 | @return The decoded image from data
75 | */
76 | - (nullable UIImage *)decodedImageWithData:(nullable NSData *)data
77 | options:(nullable SDImageCoderOptions *)options;
78 |
79 | #pragma mark - Encoding
80 |
81 | /**
82 | Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder.
83 | For custom coder which introduce new image format, you'd better define a new `SDImageFormat` using like this. If you're creating public coder plugin for new image format, also update `https://github.com/rs/SDWebImage/wiki/Coder-Plugin-List` to avoid same value been defined twice.
84 | * @code
85 | static const SDImageFormat SDImageFormatHEIF = 10;
86 | * @endcode
87 |
88 | @param format The image format
89 | @return YES if this coder can encode the image, NO otherwise
90 | */
91 | - (BOOL)canEncodeToFormat:(SDImageFormat)format NS_SWIFT_NAME(canEncode(to:));
92 |
93 | /**
94 | Encode the image to image data.
95 | @note This protocol may supports encode animated image frames. You can use `+[SDImageCoderHelper framesFromAnimatedImage:]` to assemble an animated image with frames.
96 |
97 | @param image The image to be encoded
98 | @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible
99 | @param options A dictionary containing any encoding options. Pass @{SDImageCoderEncodeCompressionQuality: @(1)} to specify compression quality.
100 | @return The encoded image data
101 | */
102 | - (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image
103 | format:(SDImageFormat)format
104 | options:(nullable SDImageCoderOptions *)options;
105 |
106 | @end
107 |
108 | #pragma mark - Progressive Coder
109 | /**
110 | This is the image coder protocol to provide custom progressive image decoding.
111 | These methods are all required to implement.
112 | @note Pay attention that these methods are not called from main queue.
113 | */
114 | @protocol SDProgressiveImageCoder
115 |
116 | @required
117 | /**
118 | Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder.
119 |
120 | @param data The image data so we can look at it
121 | @return YES if this coder can decode the data, NO otherwise
122 | */
123 | - (BOOL)canIncrementalDecodeFromData:(nullable NSData *)data;
124 |
125 | /**
126 | 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
127 | This init method should not return nil
128 |
129 | @param options A dictionary containing any progressive decoding options (instance-level). Pass @{SDImageCoderDecodeScaleFactor: @(1.0)} to specify scale factor for progressive animated image (each frames should use the same scale).
130 | @return A new instance to do incremental decoding for the specify image format
131 | */
132 | - (nonnull instancetype)initIncrementalWithOptions:(nullable SDImageCoderOptions *)options;
133 |
134 | /**
135 | Update the incremental decoding when new image data available
136 |
137 | @param data The image data has been downloaded so far
138 | @param finished Whether the download has finished
139 | */
140 | - (void)updateIncrementalData:(nullable NSData *)data finished:(BOOL)finished;
141 |
142 | /**
143 | Incremental decode the current image data to image.
144 | @note Due to the performance issue for progressive decoding and the integration for image view. This method may only return the first frame image even if the image data is animated image. If you want progressive animated image decoding, conform to `SDAnimatedImageCoder` protocol as well and use `animatedImageFrameAtIndex:` instead.
145 |
146 | @param options A dictionary containing any progressive decoding options. Pass @{SDImageCoderDecodeScaleFactor: @(1.0)} to specify scale factor for progressive image
147 | @return The decoded image from current data
148 | */
149 | - (nullable UIImage *)incrementalDecodedImageWithOptions:(nullable SDImageCoderOptions *)options;
150 |
151 | @end
152 |
153 | #pragma mark - Animated Image Provider
154 | /**
155 | This is the animated image protocol to provide the basic function for animated image rendering. It's adopted by `SDAnimatedImage` and `SDAnimatedImageCoder`
156 | */
157 | @protocol SDAnimatedImageProvider
158 |
159 | @required
160 | /**
161 | The original animated image data for current image. If current image is not an animated format, return nil.
162 | We may use this method to grab back the original image data if need, such as NSCoding or compare.
163 |
164 | @return The animated image data
165 | */
166 | @property (nonatomic, copy, readonly, nullable) NSData *animatedImageData;
167 |
168 | /**
169 | Total animated frame count.
170 | If the frame count is less than 1, then the methods below will be ignored.
171 |
172 | @return Total animated frame count.
173 | */
174 | @property (nonatomic, assign, readonly) NSUInteger animatedImageFrameCount;
175 | /**
176 | Animation loop count, 0 means infinite looping.
177 |
178 | @return Animation loop count
179 | */
180 | @property (nonatomic, assign, readonly) NSUInteger animatedImageLoopCount;
181 | /**
182 | Returns the frame image from a specified index.
183 | @note The index maybe randomly if one image was set to different imageViews, keep it re-entrant. (It's not recommend to store the images into array because it's memory consuming)
184 |
185 | @param index Frame index (zero based).
186 | @return Frame's image
187 | */
188 | - (nullable UIImage *)animatedImageFrameAtIndex:(NSUInteger)index;
189 | /**
190 | Returns the frames's duration from a specified index.
191 | @note The index maybe randomly if one image was set to different imageViews, keep it re-entrant. (It's recommend to store the durations into array because it's not memory-consuming)
192 |
193 | @param index Frame index (zero based).
194 | @return Frame's duration
195 | */
196 | - (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index;
197 |
198 | @end
199 |
200 | #pragma mark - Animated Coder
201 | /**
202 | This is the animated image coder protocol for custom animated image class like `SDAnimatedImage`. Through it inherit from `SDImageCoder`. We currentlly only use the method `canDecodeFromData:` to detect the proper coder for specify animated image format.
203 | */
204 | @protocol SDAnimatedImageCoder
205 |
206 | @required
207 | /**
208 | Because animated image coder should keep the original data, we will alloc a new instance with the same class for the specify animated image data
209 | The init method should return nil if it can't decode the specify animated image data to produce any frame.
210 | After the instance created, we may call methods in `SDAnimatedImageProvider` to produce animated image frame.
211 |
212 | @param data The animated image data to be decode
213 | @param options A dictionary containing any animated decoding options (instance-level). Pass @{SDImageCoderDecodeScaleFactor: @(1.0)} to specify scale factor for animated image (each frames should use the same scale).
214 | @return A new instance to do animated decoding for specify image data
215 | */
216 | - (nullable instancetype)initWithAnimatedImageData:(nullable NSData *)data options:(nullable SDImageCoderOptions *)options;
217 |
218 | @end
219 |
--------------------------------------------------------------------------------
/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 "SDImageCacheDefine.h"
12 | #import "SDImageLoader.h"
13 | #import "SDImageTransformer.h"
14 | #import "SDWebImageCacheKeyFilter.h"
15 | #import "SDWebImageCacheSerializer.h"
16 |
17 | typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL);
18 |
19 | typedef void(^SDInternalCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL);
20 |
21 | /**
22 | A combined operation representing the cache and loader operation. You can use it to cancel the load process.
23 | */
24 | @interface SDWebImageCombinedOperation : NSObject
25 |
26 | /**
27 | Cancel the current operation, including cache and loader process
28 | */
29 | - (void)cancel;
30 |
31 | /**
32 | The cache operation from the image cache query
33 | */
34 | @property (strong, nonatomic, nullable, readonly) id cacheOperation;
35 |
36 | /**
37 | The loader operation from the image loader (such as download operation)
38 | */
39 | @property (strong, nonatomic, nullable, readonly) id loaderOperation;
40 |
41 | @end
42 |
43 |
44 | @class SDWebImageManager;
45 |
46 | /**
47 | The manager delegate protocol.
48 | */
49 | @protocol SDWebImageManagerDelegate
50 |
51 | @optional
52 |
53 | /**
54 | * Controls which image should be downloaded when the image is not found in the cache.
55 | *
56 | * @param imageManager The current `SDWebImageManager`
57 | * @param imageURL The url of the image to be downloaded
58 | *
59 | * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied.
60 | */
61 | - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldDownloadImageForURL:(nonnull NSURL *)imageURL;
62 |
63 | /**
64 | * Controls the complicated logic to mark as failed URLs when download error occur.
65 | * If the delegate implement this method, we will not use the built-in way to mark URL as failed based on error code;
66 | @param imageManager The current `SDWebImageManager`
67 | @param imageURL The url of the image
68 | @param error The download error for the url
69 | @return Whether to block this url or not. Return YES to mark this URL as failed.
70 | */
71 | - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldBlockFailedURL:(nonnull NSURL *)imageURL withError:(nonnull NSError *)error;
72 |
73 | @end
74 |
75 | /**
76 | * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes.
77 | * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache).
78 | * You can use this class directly to benefit from web image downloading with caching in another context than
79 | * a UIView.
80 | *
81 | * Here is a simple example of how to use SDWebImageManager:
82 | *
83 | * @code
84 |
85 | SDWebImageManager *manager = [SDWebImageManager sharedManager];
86 | [manager loadImageWithURL:imageURL
87 | options:0
88 | progress:nil
89 | completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
90 | if (image) {
91 | // do something with image
92 | }
93 | }];
94 |
95 | * @endcode
96 | */
97 | @interface SDWebImageManager : NSObject
98 |
99 | /**
100 | * The delegate for manager. Defatuls to nil.
101 | */
102 | @property (weak, nonatomic, nullable) id delegate;
103 |
104 | /**
105 | * The image cache used by manager to query image cache.
106 | */
107 | @property (strong, nonatomic, readonly, nonnull) id imageCache;
108 |
109 | /**
110 | * The image loader used by manager to load image.
111 | */
112 | @property (strong, nonatomic, readonly, nonnull) id imageLoader;
113 |
114 | /**
115 | The image transformer for manager. It's used for image transform after the image load finished and store the transformed image to cache, see `SDImageTransformer`.
116 | Defaults to nil, which means no transform is applied.
117 | @note This will affect all the load requests for this manager if you provide. However, you can pass `SDWebImageContextImageTransformer` in context arg to explicitly use that transformer instead.
118 | */
119 | @property (strong, nonatomic, nullable) id transformer;
120 |
121 | /**
122 | * The cache filter is used to convert an URL into a cache key each time SDWebImageManager need cache key to use image cache.
123 | *
124 | * The following example sets a filter in the application delegate that will remove any query-string from the
125 | * URL before to use it as a cache key:
126 | *
127 | * @code
128 | SDWebImageManager.sharedManager.cacheKeyFilter =[SDWebImageCacheKeyFilter cacheKeyFilterWithBlock:^NSString * _Nullable(NSURL * _Nonnull url) {
129 | url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path];
130 | return [url absoluteString];
131 | }];
132 | * @endcode
133 | */
134 | @property (nonatomic, strong, nullable) id cacheKeyFilter;
135 |
136 | /**
137 | * The cache serializer is 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`.
138 | * 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.
139 | * @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.
140 | * @note This method is called from a global queue in order to not to block the main thread.
141 | * @code
142 | SDWebImageManager.sharedManager.cacheSerializer = [SDWebImageCacheSerializer cacheSerializerWithBlock:^NSData * _Nullable(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL) {
143 | SDImageFormat format = [NSData sd_imageFormatForImageData:data];
144 | switch (format) {
145 | case SDImageFormatWebP:
146 | return image.images ? data : nil;
147 | default:
148 | return data;
149 | }
150 | }];
151 | * @endcode
152 | * The default value is nil. Means we just store the source downloaded data to disk cache.
153 | */
154 | @property (nonatomic, strong, nullable) id cacheSerializer;
155 |
156 | /**
157 | * Check one or more operations running
158 | */
159 | @property (nonatomic, assign, readonly, getter=isRunning) BOOL running;
160 |
161 | /**
162 | The default image cache when the manager which is created with no arguments. Such as shared manager or init.
163 | Defaults to nil. Means using `SDImageCache.sharedImageCache`
164 | */
165 | @property (nonatomic, class, nullable) id defaultImageCache;
166 |
167 | /**
168 | The default image loader for manager which is created with no arguments. Such as shared manager or init.
169 | Defaults to nil. Means using `SDWebImageDownloader.sharedDownloader`
170 | */
171 | @property (nonatomic, class, nullable) id defaultImageLoader;
172 |
173 | /**
174 | * Returns global shared manager instance.
175 | */
176 | @property (nonatomic, class, readonly, nonnull) SDWebImageManager *sharedManager;
177 |
178 | /**
179 | * Allows to specify instance of cache and image loader used with image manager.
180 | * @return new instance of `SDWebImageManager` with specified cache and loader.
181 | */
182 | - (nonnull instancetype)initWithCache:(nonnull id)cache loader:(nonnull id)loader NS_DESIGNATED_INITIALIZER;
183 |
184 | /**
185 | * Downloads the image at the given URL if not present in cache or return the cached version otherwise.
186 | *
187 | * @param url The URL to the image
188 | * @param options A mask to specify options to use for this request
189 | * @param progressBlock A block called while image is downloading
190 | * @note the progress block is executed on a background queue
191 | * @param completedBlock A block called when operation has been completed.
192 | *
193 | * This parameter is required.
194 | *
195 | * This block has no return value and takes the requested UIImage as first parameter and the NSData representation as second parameter.
196 | * In case of error the image parameter is nil and the third parameter may contain an NSError.
197 | *
198 | * The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache
199 | * or from the memory cache or from the network.
200 | *
201 | * The fith parameter is set to NO when the SDWebImageProgressiveLoad option is used and the image is
202 | * downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
203 | * block is called a last time with the full image and the last parameter set to YES.
204 | *
205 | * The last parameter is the original image URL
206 | *
207 | * @return Returns an instance of SDWebImageCombinedOperation, which you can cancel the loading process.
208 | */
209 | - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url
210 | options:(SDWebImageOptions)options
211 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
212 | completed:(nonnull SDInternalCompletionBlock)completedBlock;
213 |
214 | /**
215 | * Downloads the image at the given URL if not present in cache or return the cached version otherwise.
216 | *
217 | * @param url The URL to the image
218 | * @param options A mask to specify options to use for this request
219 | * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
220 | * @param progressBlock A block called while image is downloading
221 | * @note the progress block is executed on a background queue
222 | * @param completedBlock A block called when operation has been completed.
223 | *
224 | * @return Returns an instance of SDWebImageCombinedOperation, which you can cancel the loading process.
225 | */
226 | - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url
227 | options:(SDWebImageOptions)options
228 | context:(nullable SDWebImageContext *)context
229 | progress:(nullable SDImageLoaderProgressBlock)progressBlock
230 | completed:(nonnull SDInternalCompletionBlock)completedBlock;
231 |
232 | /**
233 | * Cancel all current operations
234 | */
235 | - (void)cancelAll;
236 |
237 | /**
238 | * Return the cache key for a given URL
239 | */
240 | - (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url;
241 |
242 | @end
243 |
--------------------------------------------------------------------------------