WebImage

YYWebImage

WebImage_第1张图片
YYImage_sequence.png
WebImage_第2张图片
YYImage.png

YYImage - base on YYImageDecoder
+imageNamed
+imageWithContentsOfFile
+imageWithData:scale:

YYFrameImage - model
-initWithImagePaths
-initWithImageDataArray

YYSpriteImage - model
-initWithSpriteSheetImage

YYAnimatedImageView - queue for imagePerFrame
_YYAnimatedImageViewFetchOperation
YYAnimatedImage

YYImageCoder
YYImageFrame
YYImageDecoder
YYImageEncoder
UIImage (YYImageCoder)

YYImageCache - base on YYMemory/DiskCache
+sharedCache - once + path
-initWithPath - YYMemory/DiskCache

/p - decodeForDisplay
-set - Memory - image(imageByDecoded) OR (imageData-image)
- Disk - imageData OR (image-data)
-get
-removeForkey
-contains

YYWebImageOperation - NSURLConnection + state + _cache + holdThread + callbackAllBlock + delegate
i. -initWithRequest
ii. _startOperation - memory cache + _options(disk cache) OR _startRequest
iii. -delegate - Challenge + URLCache + (error & data) + progressive(YYImageDecoder)* + (imageType(cache) + transformBlock)
iv. -override - Activity + _completion + _startOperation + bgTask

YYWebImageManager
+sharedManager
-initWithCache:queue
-requestImageWithURL - YYWebImageOperation

——————————

Entry Point:

UIImageView (YYWebImage)
-setImageWithURL

UIButton (YYWebImage)
_YYWebImageSetterDicForButton
-setImageWithURL:forState

CALayer (YYWebImage)
-setImageWithURL

MKAnnotationView (YYWebImage)
-setImageWithURL

_YYWebImageSetter
-setOperationWithSentinel - NSOperation
-cancelWithNewURL - _operation cancel



SDWebImage

WebImage_第3张图片
SDWebImage_sequence.png
WebImage_第4张图片
SDWebImage.png

SDWebImageCompat
SDWebImageOperation
-cancel

SDWebImageDownloader - NSOperationQueue + NSURLSession
+sharedDownloader
-initWithSessionConfiguration
-downloadImageWithURL - addProgressCallback - (SDWebImageDownloaderOperation(request+credential+queue) & SDWebImageDownloadToken)
-delegate

SDWebImageDownloaderOperation - state + dataTask + callbackAllBlock + notification
OperationInterface
-initWithRequest
-addHandlersForProgress

-start - bgTask + options + dataTask + progressBlock
-cancel - dataTaskCancel + notification
-delegate - options(ProgressiveDownload) + progressBlock + completionBlock + URLCache + Challenge + (decodedImage & shouldDecompressImages)

SDImageCache
SDImageCacheConfig - model

SDWebImageCodersManager

SDWebImageManager - cache & downloader
+sharedManager
-initWithCache:downloader:
-loadImageWithURL - operation.cacheBlock{ download(options + downloader{image}) + cache + none }

SDWebImagePrefetcher
SDWebImageTransition - model

——————————

NSData (ImageContentType)
-sd_imageFormatForImageData
-sd_UTTypeFromSDImageFormat

UIImage (GIF)
UIImage (MultiFormat)
UIImage (WebP)
UIImage (ForceDecode)

UIView (WebCacheOperation) - AssociatedMapTable
-sd_setImageLoadOperation
-sd_cancelImageLoadOperationWithKey
-sd_removeImageLoadOperationWithKey

——————————

Entry Point:

MKAnnotationView (WebCache) - UIView (WebCache)
-sd_setImageWithURL

UIButton (WebCache) - UIView (WebCache)
-sd_setImageWithURL:forState
-AssociatedDict cache

UIImageView (WebCache) - UIView (WebCache)
-sd_setImageWithURL
-sd_setAnimationImagesWithURLs - PointerAssociatedArray

UIImageView (HighlightedWebCache) - UIView (WebCache)
-sd_setHighlightedImageWithURL

FLAnimatedImageView (WebCache)
-sd_setImageWithURL

UIView (WebCache)
-AssociatedURL&Progress
-&SDWebImageTransition&(UIActivityIndicatorView&show&style)

-sd_internalSetImageWithURL - self.NSProgress + progressBlock + completedBlock + about SDWebImageOptions + cache
-sd_setImage - UIImageView & UIButton + transition

你可能感兴趣的:(WebImage)