diff --git a/SDWebImage.xcodeproj/project.pbxproj b/SDWebImage.xcodeproj/project.pbxproj index ae449009..5e5b8210 100644 --- a/SDWebImage.xcodeproj/project.pbxproj +++ b/SDWebImage.xcodeproj/project.pbxproj @@ -49,30 +49,30 @@ 320CAE1E2086F50500CFFC80 /* SDWebImageError.m in Sources */ = {isa = PBXBuildFile; fileRef = 320CAE142086F50500CFFC80 /* SDWebImageError.m */; }; 320CAE1F2086F50500CFFC80 /* SDWebImageError.m in Sources */ = {isa = PBXBuildFile; fileRef = 320CAE142086F50500CFFC80 /* SDWebImageError.m */; }; 320CAE202086F50500CFFC80 /* SDWebImageError.m in Sources */ = {isa = PBXBuildFile; fileRef = 320CAE142086F50500CFFC80 /* SDWebImageError.m */; }; - 321B37812083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37822083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37832083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37842083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37852083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37862083290E00C0EA77 /* SDWebImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37872083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B37882083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B37892083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B378A2083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B378B2083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B378C2083290E00C0EA77 /* SDWebImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */; }; - 321B378D2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B378E2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B378F2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37902083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37912083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37922083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 321B37932083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; - 321B37942083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; - 321B37952083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; - 321B37962083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; - 321B37972083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; - 321B37982083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */; }; + 321B37812083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37822083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37832083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37842083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37852083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37862083290E00C0EA77 /* SDImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377D2083290D00C0EA77 /* SDImageLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37872083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B37882083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B37892083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B378A2083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B378B2083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B378C2083290E00C0EA77 /* SDImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B377E2083290D00C0EA77 /* SDImageLoader.m */; }; + 321B378D2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B378E2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B378F2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37902083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37912083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37922083290E00C0EA77 /* SDImageLoadersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 321B37932083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; + 321B37942083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; + 321B37952083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; + 321B37962083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; + 321B37972083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; + 321B37982083290E00C0EA77 /* SDImageLoadersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */; }; 321DB3612011D4D70015D2CB /* NSButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 321DB35F2011D4D60015D2CB /* NSButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 321DB3622011D4D70015D2CB /* NSButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 321DB3602011D4D60015D2CB /* NSButton+WebCache.m */; }; 321E60861F38E8C800405457 /* SDImageCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 321E60841F38E8C800405457 /* SDImageCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1545,10 +1545,10 @@ 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDAnimatedImageRep.m; sourceTree = ""; }; 320CAE132086F50500CFFC80 /* SDWebImageError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDWebImageError.h; sourceTree = ""; }; 320CAE142086F50500CFFC80 /* SDWebImageError.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDWebImageError.m; sourceTree = ""; }; - 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDWebImageLoader.h; sourceTree = ""; }; - 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageLoader.m; sourceTree = ""; }; - 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDWebImageLoadersManager.h; sourceTree = ""; }; - 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageLoadersManager.m; sourceTree = ""; }; + 321B377D2083290D00C0EA77 /* SDImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDImageLoader.h; sourceTree = ""; }; + 321B377E2083290D00C0EA77 /* SDImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDImageLoader.m; sourceTree = ""; }; + 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDImageLoadersManager.h; sourceTree = ""; }; + 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDImageLoadersManager.m; sourceTree = ""; }; 321DB35F2011D4D60015D2CB /* NSButton+WebCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSButton+WebCache.h"; path = "SDWebImage/NSButton+WebCache.h"; sourceTree = ""; }; 321DB3602011D4D60015D2CB /* NSButton+WebCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSButton+WebCache.m"; path = "SDWebImage/NSButton+WebCache.m"; sourceTree = ""; }; 321E60841F38E8C800405457 /* SDImageCoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDImageCoder.h; sourceTree = ""; }; @@ -2185,10 +2185,10 @@ 32B9B536206ED4230026769D /* SDWebImageDownloaderConfig.m */, 32F21B4F20788D8C0036B1D5 /* SDWebImageDownloaderRequestModifier.h */, 32F21B5020788D8C0036B1D5 /* SDWebImageDownloaderRequestModifier.m */, - 321B377D2083290D00C0EA77 /* SDWebImageLoader.h */, - 321B377E2083290D00C0EA77 /* SDWebImageLoader.m */, - 321B377F2083290E00C0EA77 /* SDWebImageLoadersManager.h */, - 321B37802083290E00C0EA77 /* SDWebImageLoadersManager.m */, + 321B377D2083290D00C0EA77 /* SDImageLoader.h */, + 321B377E2083290D00C0EA77 /* SDImageLoader.m */, + 321B377F2083290E00C0EA77 /* SDImageLoadersManager.h */, + 321B37802083290E00C0EA77 /* SDImageLoadersManager.m */, ); name = Downloader; sourceTree = ""; @@ -2398,7 +2398,7 @@ 32B9B53A206ED4230026769D /* SDWebImageDownloaderConfig.h in Headers */, 328BB6AD2081FEE500760D6C /* SDWebImageCacheSerializer.h in Headers */, 80377C4A1F2F666300F89830 /* bit_writer_utils.h in Headers */, - 321B37902083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B37902083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 323F8BE71F38EF770092B609 /* vp8li_enc.h in Headers */, 329A185C1FFF5DFD008C9A2F /* UIImage+WebCache.h in Headers */, 4369C27A1D9807EC007E863A /* UIView+WebCache.h in Headers */, @@ -2441,7 +2441,7 @@ 328BB6D02082581100760D6C /* SDMemoryCache.h in Headers */, 321E60891F38E8C800405457 /* SDImageCoder.h in Headers */, 00733A721BC4880E00A5A117 /* UIView+WebCacheOperation.h in Headers */, - 321B37842083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37842083290E00C0EA77 /* SDImageLoader.h in Headers */, 80377C481F2F666300F89830 /* bit_reader_utils.h in Headers */, 80377C511F2F666300F89830 /* huffman_encode_utils.h in Headers */, 32484778201775F600AF9E5A /* SDAnimatedImage.h in Headers */, @@ -2520,7 +2520,7 @@ 4314D16F1D0E0E3B004B36C9 /* NSData+ImageContentType.h in Headers */, 80377C121F2F666300F89830 /* bit_reader_inl_utils.h in Headers */, 4314D1701D0E0E3B004B36C9 /* mux.h in Headers */, - 321B378E2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B378E2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 321E60871F38E8C800405457 /* SDImageCoder.h in Headers */, 80377EA21F2F66D400F89830 /* vp8i_dec.h in Headers */, 320CAE162086F50500CFFC80 /* SDWebImageError.h in Headers */, @@ -2529,7 +2529,7 @@ 80377C211F2F666300F89830 /* quant_levels_dec_utils.h in Headers */, 4314D1721D0E0E3B004B36C9 /* SDWebImageCompat.h in Headers */, 32484776201775F600AF9E5A /* SDAnimatedImage.h in Headers */, - 321B37822083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37822083290E00C0EA77 /* SDImageLoader.h in Headers */, 80377C251F2F666300F89830 /* random_utils.h in Headers */, 80377D4F1F2F66A700F89830 /* lossless.h in Headers */, 80377D511F2F66A700F89830 /* msa_macro.h in Headers */, @@ -2585,7 +2585,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 321B37912083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B37912083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 80377C791F2F666400F89830 /* utils.h in Headers */, 328BB6A02081FED200760D6C /* SDWebImageCacheKeyFilter.h in Headers */, 323F8B721F38EF770092B609 /* delta_palettization_enc.h in Headers */, @@ -2598,7 +2598,7 @@ 32484767201775F600AF9E5A /* SDAnimatedImageView+WebCache.h in Headers */, 80377C601F2F666400F89830 /* bit_reader_inl_utils.h in Headers */, 32FDE89920888726008D7530 /* UIImage+WebP.h in Headers */, - 321B37852083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37852083290E00C0EA77 /* SDImageLoader.h in Headers */, 329A185D1FFF5DFD008C9A2F /* UIImage+WebCache.h in Headers */, 431BB6DC1D06D2C1006A3455 /* UIButton+WebCache.h in Headers */, 431BB6E11D06D2C1006A3455 /* SDWebImage.h in Headers */, @@ -2693,7 +2693,7 @@ 32B9B53C206ED4230026769D /* SDWebImageDownloaderConfig.h in Headers */, 328BB6AF2081FEE500760D6C /* SDWebImageCacheSerializer.h in Headers */, 4397D2BA1D0DDD8C00BB2784 /* demux.h in Headers */, - 321B37922083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B37922083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 80377C8F1F2F666400F89830 /* rescaler_utils.h in Headers */, 4397D2BD1D0DDD8C00BB2784 /* types.h in Headers */, 4397D2C01D0DDD8C00BB2784 /* SDWebImage.h in Headers */, @@ -2739,7 +2739,7 @@ 328BB6D22082581100760D6C /* SDMemoryCache.h in Headers */, 323F8BDD1F38EF770092B609 /* vp8i_enc.h in Headers */, 323F8B671F38EF770092B609 /* cost_enc.h in Headers */, - 321B37862083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37862083290E00C0EA77 /* SDImageLoader.h in Headers */, 80377EE11F2F66D500F89830 /* vp8_dec.h in Headers */, 80377EE41F2F66D500F89830 /* vp8li_dec.h in Headers */, 80377C931F2F666400F89830 /* utils.h in Headers */, @@ -2794,7 +2794,7 @@ 32B9B539206ED4230026769D /* SDWebImageDownloaderConfig.h in Headers */, 328BB6AC2081FEE500760D6C /* SDWebImageCacheSerializer.h in Headers */, 80377C301F2F666300F89830 /* bit_writer_utils.h in Headers */, - 321B378F2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B378F2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 431739541CDFC8B70008FEB9 /* types.h in Headers */, 323F8BE61F38EF770092B609 /* vp8li_enc.h in Headers */, 329A185B1FFF5DFD008C9A2F /* UIImage+WebCache.h in Headers */, @@ -2839,7 +2839,7 @@ 328BB6CF2082581100760D6C /* SDMemoryCache.h in Headers */, 321E60881F38E8C800405457 /* SDImageCoder.h in Headers */, 4A2CAE371AB4BB7500B6BC39 /* UIView+WebCacheOperation.h in Headers */, - 321B37832083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37832083290E00C0EA77 /* SDImageLoader.h in Headers */, 80377C2E1F2F666300F89830 /* bit_reader_utils.h in Headers */, 80377C371F2F666300F89830 /* huffman_encode_utils.h in Headers */, 32484777201775F600AF9E5A /* SDAnimatedImage.h in Headers */, @@ -2931,7 +2931,7 @@ 321E60BE1F38E91700405457 /* UIImage+ForceDecode.h in Headers */, 5376131E155AD0D5005750A4 /* SDWebImagePrefetcher.h in Headers */, 32F7C06F2030114C00873181 /* SDImageTransformer.h in Headers */, - 321B378D2083290E00C0EA77 /* SDWebImageLoadersManager.h in Headers */, + 321B378D2083290E00C0EA77 /* SDImageLoadersManager.h in Headers */, 32FDE8A220888789008D7530 /* SDWebImage.h in Headers */, 324DF4B4200A14DC008A84CC /* SDWebImageDefine.h in Headers */, 80377CE11F2F66A100F89830 /* common_sse2.h in Headers */, @@ -2958,7 +2958,7 @@ 32FDE88F20888726008D7530 /* SDImageWebPCoder.h in Headers */, 320CAE152086F50500CFFC80 /* SDWebImageError.h in Headers */, 323F8B861F38EF770092B609 /* histogram_enc.h in Headers */, - 321B37812083290E00C0EA77 /* SDWebImageLoader.h in Headers */, + 321B37812083290E00C0EA77 /* SDImageLoader.h in Headers */, 323F8BF61F38EF770092B609 /* animi.h in Headers */, 321E60861F38E8C800405457 /* SDImageCoder.h in Headers */, 80377C0D1F2F665300F89830 /* rescaler_utils.h in Headers */, @@ -3259,7 +3259,7 @@ 80377DD71F2F66A700F89830 /* lossless_sse2.c in Sources */, 80377DA81F2F66A700F89830 /* alpha_processing_mips_dsp_r2.c in Sources */, 80377DB11F2F66A700F89830 /* cost_mips_dsp_r2.c in Sources */, - 321B37962083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37962083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 80377C581F2F666300F89830 /* random_utils.c in Sources */, 323F8B591F38EF770092B609 /* config_enc.c in Sources */, 80377DE91F2F66A700F89830 /* yuv_mips32.c in Sources */, @@ -3319,7 +3319,7 @@ 80377C561F2F666300F89830 /* quant_levels_utils.c in Sources */, 323F8BCF1F38EF770092B609 /* token_enc.c in Sources */, 80377DD11F2F66A700F89830 /* lossless_enc_sse2.c in Sources */, - 321B378A2083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B378A2083290E00C0EA77 /* SDImageLoader.m in Sources */, 32484772201775F600AF9E5A /* SDAnimatedImage.m in Sources */, 323F8C1D1F38EF770092B609 /* muxread.c in Sources */, 807A12311F89636300EC2A9B /* SDImageCodersManager.m in Sources */, @@ -3463,7 +3463,7 @@ 80377E9C1F2F66D400F89830 /* idec_dec.c in Sources */, 323F8B7B1F38EF770092B609 /* frame_enc.c in Sources */, 80377D211F2F66A700F89830 /* alpha_processing_sse41.c in Sources */, - 321B37942083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37942083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 323F8B8D1F38EF770092B609 /* iterator_enc.c in Sources */, 3248475E201775F600AF9E5A /* SDAnimatedImageView.m in Sources */, 80377D481F2F66A700F89830 /* lossless_enc_sse41.c in Sources */, @@ -3524,7 +3524,7 @@ 80377E991F2F66D400F89830 /* buffer_dec.c in Sources */, 80377C201F2F666300F89830 /* quant_levels_dec_utils.c in Sources */, 32F7C07F2030719600873181 /* UIImage+Transform.m in Sources */, - 321B37882083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B37882083290E00C0EA77 /* SDImageLoader.m in Sources */, 80377D471F2F66A700F89830 /* lossless_enc_sse2.c in Sources */, 80377C1E1F2F666300F89830 /* huffman_utils.c in Sources */, ); @@ -3630,7 +3630,7 @@ 80377DF01F2F66A800F89830 /* alpha_processing_sse41.c in Sources */, 80377ECC1F2F66D500F89830 /* idec_dec.c in Sources */, 323F8B7E1F38EF770092B609 /* frame_enc.c in Sources */, - 321B37972083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37972083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 80377E171F2F66A800F89830 /* lossless_enc_sse41.c in Sources */, 32484761201775F600AF9E5A /* SDAnimatedImageView.m in Sources */, 323F8B901F38EF770092B609 /* iterator_enc.c in Sources */, @@ -3690,7 +3690,7 @@ 80377EC91F2F66D500F89830 /* buffer_dec.c in Sources */, 80377C6C1F2F666400F89830 /* huffman_utils.c in Sources */, 32F7C0822030719600873181 /* UIImage+Transform.m in Sources */, - 321B378B2083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B378B2083290E00C0EA77 /* SDImageLoader.m in Sources */, 80377E161F2F66A800F89830 /* lossless_enc_sse2.c in Sources */, 431BB6C71D06D2C1006A3455 /* UIImageView+HighlightedWebCache.m in Sources */, ); @@ -3780,7 +3780,7 @@ 32F21B5C20788D8C0036B1D5 /* SDWebImageDownloaderRequestModifier.m in Sources */, 32D122292080B2EB003685A3 /* SDImageCacheDefine.m in Sources */, 80377E3B1F2F66A800F89830 /* cost_mips_dsp_r2.c in Sources */, - 321B378C2083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B378C2083290E00C0EA77 /* SDImageLoader.m in Sources */, 4397D29B1D0DDD8C00BB2784 /* SDWebImageDownloader.m in Sources */, 80377E711F2F66A800F89830 /* upsampling.c in Sources */, 328BB6A72081FED200760D6C /* SDWebImageCacheKeyFilter.m in Sources */, @@ -3857,7 +3857,7 @@ 323F8B851F38EF770092B609 /* histogram_enc.c in Sources */, 80377EE51F2F66D500F89830 /* webp_dec.c in Sources */, 4397D2B01D0DDD8C00BB2784 /* SDImageCache.m in Sources */, - 321B37982083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37982083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 32F7C07A2030114C00873181 /* SDImageTransformer.m in Sources */, 80377E4F1F2F66A800F89830 /* enc_sse41.c in Sources */, 80377E701F2F66A800F89830 /* upsampling_sse2.c in Sources */, @@ -3928,7 +3928,7 @@ 80377D921F2F66A700F89830 /* lossless_sse2.c in Sources */, 80377D631F2F66A700F89830 /* alpha_processing_mips_dsp_r2.c in Sources */, 80377D6C1F2F66A700F89830 /* cost_mips_dsp_r2.c in Sources */, - 321B37952083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37952083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 4A2CAE361AB4BB7500B6BC39 /* UIImageView+WebCache.m in Sources */, 323F8B581F38EF770092B609 /* config_enc.c in Sources */, 43C892A21D9D6DDD0022038D /* demux.c in Sources */, @@ -3988,7 +3988,7 @@ 4A2CAE191AB4BB6400B6BC39 /* SDWebImageCompat.m in Sources */, 80377DA11F2F66A700F89830 /* upsampling_sse2.c in Sources */, 323F8BCE1F38EF770092B609 /* token_enc.c in Sources */, - 321B37892083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B37892083290E00C0EA77 /* SDImageLoader.m in Sources */, 32484771201775F600AF9E5A /* SDAnimatedImage.m in Sources */, 80377C3C1F2F666300F89830 /* quant_levels_utils.c in Sources */, 323F8C1C1F38EF770092B609 /* muxread.c in Sources */, @@ -4099,7 +4099,7 @@ 80377CD91F2F66A100F89830 /* alpha_processing_mips_dsp_r2.c in Sources */, 80377CE21F2F66A100F89830 /* cost_mips_dsp_r2.c in Sources */, 5376130B155AD0D5005750A4 /* SDWebImageDownloader.m in Sources */, - 321B37932083290E00C0EA77 /* SDWebImageLoadersManager.m in Sources */, + 321B37932083290E00C0EA77 /* SDImageLoadersManager.m in Sources */, 323F8B561F38EF770092B609 /* config_enc.c in Sources */, 43C8929B1D9D6DD70022038D /* demux.c in Sources */, 80377D1A1F2F66A100F89830 /* yuv_mips32.c in Sources */, @@ -4158,7 +4158,7 @@ 80377D171F2F66A100F89830 /* upsampling_sse2.c in Sources */, 323F8BCC1F38EF770092B609 /* token_enc.c in Sources */, 80377C081F2F665300F89830 /* quant_levels_utils.c in Sources */, - 321B37872083290E00C0EA77 /* SDWebImageLoader.m in Sources */, + 321B37872083290E00C0EA77 /* SDImageLoader.m in Sources */, 3248476F201775F600AF9E5A /* SDAnimatedImage.m in Sources */, 323F8C1A1F38EF770092B609 /* muxread.c in Sources */, 807A122E1F89636300EC2A9B /* SDImageCodersManager.m in Sources */, diff --git a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h index f046f7a6..c3896efb 100644 --- a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h +++ b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.h @@ -153,7 +153,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m index 51833df0..203b9118 100644 --- a/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m +++ b/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m @@ -80,7 +80,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -88,7 +88,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { dispatch_group_t group = dispatch_group_create(); SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/MapKit/MKAnnotationView+WebCache.h b/SDWebImage/MapKit/MKAnnotationView+WebCache.h index 7fec73d8..f8a87555 100644 --- a/SDWebImage/MapKit/MKAnnotationView+WebCache.h +++ b/SDWebImage/MapKit/MKAnnotationView+WebCache.h @@ -123,7 +123,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -147,7 +147,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/MapKit/MKAnnotationView+WebCache.m b/SDWebImage/MapKit/MKAnnotationView+WebCache.m index c228249b..d72785ca 100644 --- a/SDWebImage/MapKit/MKAnnotationView+WebCache.m +++ b/SDWebImage/MapKit/MKAnnotationView+WebCache.m @@ -40,7 +40,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -48,7 +48,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { __weak typeof(self)weakSelf = self; [self sd_internalSetImageWithURL:url diff --git a/SDWebImage/NSButton+WebCache.h b/SDWebImage/NSButton+WebCache.h index 0edb7a4b..1f854779 100644 --- a/SDWebImage/NSButton+WebCache.h +++ b/SDWebImage/NSButton+WebCache.h @@ -125,7 +125,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -149,7 +149,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Alternate Image @@ -263,7 +263,7 @@ - (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -287,7 +287,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Cancel diff --git a/SDWebImage/NSButton+WebCache.m b/SDWebImage/NSButton+WebCache.m index b8f5092b..30af27fb 100644 --- a/SDWebImage/NSButton+WebCache.m +++ b/SDWebImage/NSButton+WebCache.m @@ -44,7 +44,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -52,7 +52,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { self.sd_currentImageURL = url; [self sd_internalSetImageWithURL:url @@ -94,7 +94,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO [self sd_setAlternateImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setAlternateImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -102,7 +102,7 @@ static NSString * const SDAlternateImageOperationKey = @"NSButtonAlternateImageO placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { self.sd_currentAlternateImageURL = url; diff --git a/SDWebImage/SDAnimatedImageView+WebCache.h b/SDWebImage/SDAnimatedImageView+WebCache.h index 6a1b0fc1..91b29eb6 100644 --- a/SDWebImage/SDAnimatedImageView+WebCache.h +++ b/SDWebImage/SDAnimatedImageView+WebCache.h @@ -118,7 +118,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -142,7 +142,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/SDAnimatedImageView+WebCache.m b/SDWebImage/SDAnimatedImageView+WebCache.m index fa9407bb..bc8c08d8 100644 --- a/SDWebImage/SDAnimatedImageView+WebCache.m +++ b/SDWebImage/SDAnimatedImageView+WebCache.m @@ -39,7 +39,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -47,7 +47,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { Class animatedImageClass = [SDAnimatedImage class]; SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/SDWebImageLoader.h b/SDWebImage/SDImageLoader.h similarity index 81% rename from SDWebImage/SDWebImageLoader.h rename to SDWebImage/SDImageLoader.h index 250e90ec..e84843d0 100644 --- a/SDWebImage/SDWebImageLoader.h +++ b/SDWebImage/SDImageLoader.h @@ -10,9 +10,8 @@ #import "SDWebImageDefine.h" #import "SDWebImageOperation.h" -@protocol SDProgressiveImageCoder; -typedef void(^SDWebImageLoaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL); -typedef void(^SDWebImageLoaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished); +typedef void(^SDImageLoaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL); +typedef void(^SDImageLoaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished); #pragma mark - Context Options @@ -35,7 +34,7 @@ FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLoader @param context The context arg from the input @return The decoded image for current image data load from the network */ -FOUNDATION_EXPORT UIImage * _Nullable SDWebImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context); +FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context); /** 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) @@ -49,16 +48,16 @@ FOUNDATION_EXPORT UIImage * _Nullable SDWebImageLoaderDecodeImageData(NSData * _ @param context The context arg from the input @return The decoded progressive image for current image data load from the network */ -FOUNDATION_EXPORT UIImage * _Nullable SDWebImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context); +FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context); -#pragma mark - SDWebImageLoader +#pragma mark - SDImageLoader // 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. -// 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 `SDWebImageLoaderDecodeImageData` or `SDWebImageLoaderDecodeProgressiveImageData` to use the built-in decoding process and produce image (Remember to call in the global queue). And finally callback the completion block. +// 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. // 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. // @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). -@protocol SDWebImageLoader +@protocol SDImageLoader /** Whether current image loader supports to load the provide image URL. @@ -83,7 +82,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDWebImageLoaderDecodeProgressiveImageData - (nullable id)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageLoaderProgressBlock)progressBlock - completed:(nullable SDWebImageLoaderCompletedBlock)completedBlock; + progress:(nullable SDImageLoaderProgressBlock)progressBlock + completed:(nullable SDImageLoaderCompletedBlock)completedBlock; @end diff --git a/SDWebImage/SDWebImageLoader.m b/SDWebImage/SDImageLoader.m similarity index 88% rename from SDWebImage/SDWebImageLoader.m rename to SDWebImage/SDImageLoader.m index 4994efe7..cb7598a2 100644 --- a/SDWebImage/SDWebImageLoader.m +++ b/SDWebImage/SDImageLoader.m @@ -6,7 +6,7 @@ * file that was distributed with this source code. */ -#import "SDWebImageLoader.h" +#import "SDImageLoader.h" #import "SDWebImageCacheKeyFilter.h" #import "SDImageCodersManager.h" #import "SDImageCoderHelper.h" @@ -14,9 +14,9 @@ #import "UIImage+WebCache.h" #import "objc/runtime.h" -static void * SDWebImageLoaderProgressiveCoderKey = &SDWebImageLoaderProgressiveCoderKey; +static void * SDImageLoaderProgressiveCoderKey = &SDImageLoaderProgressiveCoderKey; -UIImage * _Nullable SDWebImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context) { +UIImage * _Nullable SDImageLoaderDecodeImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, SDWebImageOptions options, SDWebImageContext * _Nullable context) { NSCParameterAssert(imageData); NSCParameterAssert(imageURL); @@ -72,7 +72,7 @@ UIImage * _Nullable SDWebImageLoaderDecodeImageData(NSData * _Nonnull imageData, return image; } -UIImage * _Nullable SDWebImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context) { +UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NSData * _Nonnull imageData, NSURL * _Nonnull imageURL, BOOL finished, id _Nonnull operation, SDWebImageOptions options, SDWebImageContext * _Nullable context) { NSCParameterAssert(imageData); NSCParameterAssert(imageURL); NSCParameterAssert(operation); @@ -91,7 +91,7 @@ UIImage * _Nullable SDWebImageLoaderDecodeProgressiveImageData(NSData * _Nonnull if (scale < 1) { scale = 1; } - id progressiveCoder = objc_getAssociatedObject(operation, SDWebImageLoaderProgressiveCoderKey); + id progressiveCoder = objc_getAssociatedObject(operation, SDImageLoaderProgressiveCoderKey); if (!progressiveCoder) { // We need to create a new instance for progressive decoding to avoid conflicts for (idcoder in [SDImageCodersManager sharedManager].coders.reverseObjectEnumerator) { @@ -101,7 +101,7 @@ UIImage * _Nullable SDWebImageLoaderDecodeProgressiveImageData(NSData * _Nonnull break; } } - objc_setAssociatedObject(operation, SDWebImageLoaderProgressiveCoderKey, progressiveCoder, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + objc_setAssociatedObject(operation, SDImageLoaderProgressiveCoderKey, progressiveCoder, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } // If we can't find any progressive coder, disable progressive download if (!progressiveCoder) { diff --git a/SDWebImage/SDWebImageLoadersManager.h b/SDWebImage/SDImageLoadersManager.h similarity index 59% rename from SDWebImage/SDWebImageLoadersManager.h rename to SDWebImage/SDImageLoadersManager.h index 7b59b592..1e278628 100644 --- a/SDWebImage/SDWebImageLoadersManager.h +++ b/SDWebImage/SDImageLoadersManager.h @@ -6,29 +6,29 @@ * file that was distributed with this source code. */ -#import "SDWebImageLoader.h" +#import "SDImageLoader.h" -@interface SDWebImageLoadersManager : NSObject +@interface SDImageLoadersManager : NSObject -@property (nonatomic, class, readonly, nonnull) SDWebImageLoadersManager *sharedManager; +@property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager; /** All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority */ -@property (nonatomic, copy, readwrite, nullable) NSArray>* loaders; +@property (nonatomic, copy, readwrite, nullable) NSArray>* loaders; /** Add a new image loader to the end of loaders array. Which has the highest priority. @param loader loader */ -- (void)addLoader:(nonnull id)loader; +- (void)addLoader:(nonnull id)loader; /** Remove a image loader in the loaders array. @param loader loader */ -- (void)removeLoader:(nonnull id)loader; +- (void)removeLoader:(nonnull id)loader; @end diff --git a/SDWebImage/SDWebImageLoadersManager.m b/SDWebImage/SDImageLoadersManager.m similarity index 64% rename from SDWebImage/SDWebImageLoadersManager.m rename to SDWebImage/SDImageLoadersManager.m index 9e5850de..123113bf 100644 --- a/SDWebImage/SDWebImageLoadersManager.m +++ b/SDWebImage/SDImageLoadersManager.m @@ -6,25 +6,25 @@ * file that was distributed with this source code. */ -#import "SDWebImageLoadersManager.h" +#import "SDImageLoadersManager.h" #import "SDWebImageDownloader.h" #define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); #define UNLOCK(lock) dispatch_semaphore_signal(lock); -@interface SDWebImageLoadersManager () +@interface SDImageLoadersManager () @property (nonatomic, strong, nonnull) dispatch_semaphore_t loadersLock; @end -@implementation SDWebImageLoadersManager +@implementation SDImageLoadersManager -+ (SDWebImageLoadersManager *)sharedManager { ++ (SDImageLoadersManager *)sharedManager { static dispatch_once_t onceToken; - static SDWebImageLoadersManager *manager; + static SDImageLoadersManager *manager; dispatch_once(&onceToken, ^{ - manager = [[SDWebImageLoadersManager alloc] init]; + manager = [[SDImageLoadersManager alloc] init]; }); return manager; } @@ -41,12 +41,12 @@ #pragma mark - Loader Property -- (void)addLoader:(id)loader { - if (![loader conformsToProtocol:@protocol(SDWebImageLoader)]) { +- (void)addLoader:(id)loader { + if (![loader conformsToProtocol:@protocol(SDImageLoader)]) { return; } LOCK(self.loadersLock); - NSMutableArray> *mutableLoaders = [self.loaders mutableCopy]; + NSMutableArray> *mutableLoaders = [self.loaders mutableCopy]; if (!mutableLoaders) { mutableLoaders = [NSMutableArray array]; } @@ -55,24 +55,24 @@ UNLOCK(self.loadersLock); } -- (void)removeLoader:(id)loader { - if (![loader conformsToProtocol:@protocol(SDWebImageLoader)]) { +- (void)removeLoader:(id)loader { + if (![loader conformsToProtocol:@protocol(SDImageLoader)]) { return; } LOCK(self.loadersLock); - NSMutableArray> *mutableLoaders = [self.loaders mutableCopy]; + NSMutableArray> *mutableLoaders = [self.loaders mutableCopy]; [mutableLoaders removeObject:loader]; self.loaders = [mutableLoaders copy]; UNLOCK(self.loadersLock); } -#pragma mark - SDWebImageLoader +#pragma mark - SDImageLoader - (BOOL)canLoadWithURL:(nullable NSURL *)url { LOCK(self.loadersLock); - NSArray> *loaders = self.loaders; + NSArray> *loaders = self.loaders; UNLOCK(self.loadersLock); - for (id loader in loaders.reverseObjectEnumerator) { + for (id loader in loaders.reverseObjectEnumerator) { if ([loader canLoadWithURL:url]) { return YES; } @@ -80,14 +80,14 @@ return NO; } -- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDWebImageLoaderProgressBlock)progressBlock completed:(SDWebImageLoaderCompletedBlock)completedBlock { +- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDImageLoaderCompletedBlock)completedBlock { if (!url) { return nil; } LOCK(self.loadersLock); - NSArray> *loaders = self.loaders; + NSArray> *loaders = self.loaders; UNLOCK(self.loadersLock); - for (id loader in loaders.reverseObjectEnumerator) { + for (id loader in loaders.reverseObjectEnumerator) { if ([loader respondsToSelector:@selector(loadImageWithURL:options:context:progress:completed:)]) { return [loader loadImageWithURL:url options:options context:context progress:progressBlock completed:completedBlock]; } diff --git a/SDWebImage/SDWebImageDownloader.h b/SDWebImage/SDWebImageDownloader.h index 441941d3..4996f7c0 100644 --- a/SDWebImage/SDWebImageDownloader.h +++ b/SDWebImage/SDWebImageDownloader.h @@ -12,7 +12,7 @@ #import "SDWebImageOperation.h" #import "SDWebImageDownloaderConfig.h" #import "SDWebImageDownloaderRequestModifier.h" -#import "SDWebImageLoader.h" +#import "SDImageLoader.h" typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { /** @@ -88,8 +88,8 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; -typedef SDWebImageLoaderProgressBlock SDWebImageDownloaderProgressBlock; -typedef SDWebImageLoaderCompletedBlock SDWebImageDownloaderCompletedBlock; +typedef SDImageLoaderProgressBlock SDWebImageDownloaderProgressBlock; +typedef SDImageLoaderCompletedBlock SDWebImageDownloaderCompletedBlock; /** * A token associated with each download. Can be used to cancel a download @@ -249,10 +249,10 @@ typedef SDWebImageLoaderCompletedBlock SDWebImageDownloaderCompletedBlock; /** - SDWebImageDownloader is the built-in image loader conform to `SDWebImageLoader`. Which provide the HTTP/HTTPS/FTP download, or local file URL using NSURLSession. + SDWebImageDownloader is the built-in image loader conform to `SDImageLoader`. Which provide the HTTP/HTTPS/FTP download, or local file URL using NSURLSession. However, this downloader class itself also support customization for advanced users. You can specify `operationClass` in download config to custom download operation, See `SDWebImageDownloaderOperation`. - If you want to provide some image loader which beyond network or local file, consider to create your own custom class conform to `SDWebImageLoader`. + If you want to provide some image loader which beyond network or local file, consider to create your own custom class conform to `SDImageLoader`. */ -@interface SDWebImageDownloader (SDWebImageLoader) +@interface SDWebImageDownloader (SDImageLoader) @end diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index b107c2f7..71d96bd0 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -464,7 +464,7 @@ didReceiveResponse:(NSURLResponse *)response @end -@implementation SDWebImageDownloader (SDWebImageLoader) +@implementation SDWebImageDownloader (SDImageLoader) - (BOOL)canLoadWithURL:(NSURL *)url { if (!url) { @@ -474,7 +474,7 @@ didReceiveResponse:(NSURLResponse *)response return YES; } -- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDWebImageLoaderProgressBlock)progressBlock completed:(SDWebImageLoaderCompletedBlock)completedBlock { +- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDImageLoaderCompletedBlock)completedBlock { UIImage *cachedImage; if ([context valueForKey:SDWebImageContextLoaderCachedImage]) { cachedImage = [context valueForKey:SDWebImageContextLoaderCachedImage]; diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 7474f48f..a687367d 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -345,7 +345,7 @@ didReceiveResponse:(NSURLResponse *)response // progressive decode the image in coder queue dispatch_async(self.coderQueue, ^{ - UIImage *image = SDWebImageLoaderDecodeProgressiveImageData(imageData, self.request.URL, finished, self, [[self class] imageOptionsFromDownloaderOptions:self.options], self.context); + UIImage *image = SDImageLoaderDecodeProgressiveImageData(imageData, self.request.URL, finished, self, [[self class] imageOptionsFromDownloaderOptions:self.options], self.context); if (image) { // We do not keep the progressive decoding image even when `finished`=YES. Because they are for view rendering but not take full function from downloader options. And some coders implementation may not keep consistent between progressive decoding and normal decoding. @@ -412,7 +412,7 @@ didReceiveResponse:(NSURLResponse *)response } else { // decode the image in coder queue dispatch_async(self.coderQueue, ^{ - UIImage *image = SDWebImageLoaderDecodeImageData(imageData, self.request.URL, [[self class] imageOptionsFromDownloaderOptions:self.options], self.context); + UIImage *image = SDImageLoaderDecodeImageData(imageData, self.request.URL, [[self class] imageOptionsFromDownloaderOptions:self.options], self.context); CGSize imageSize = image.size; if (imageSize.width == 0 || imageSize.height == 0) { [self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorBadImageData userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}]]; diff --git a/SDWebImage/SDWebImageManager.h b/SDWebImage/SDWebImageManager.h index 0b5d4061..40b78468 100644 --- a/SDWebImage/SDWebImageManager.h +++ b/SDWebImage/SDWebImageManager.h @@ -9,11 +9,10 @@ #import "SDWebImageCompat.h" #import "SDWebImageOperation.h" #import "SDImageCacheDefine.h" -#import "SDWebImageDownloader.h" +#import "SDImageLoader.h" #import "SDImageTransformer.h" #import "SDWebImageCacheKeyFilter.h" #import "SDWebImageCacheSerializer.h" -#import "SDWebImageLoader.h" typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL); @@ -105,7 +104,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; /** * The image loader used by manager to load image. */ -@property (strong, nonatomic, readonly, nonnull) id imageLoader; +@property (strong, nonatomic, readonly, nonnull) id imageLoader; /** 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`. @@ -164,7 +163,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; The default image loader for manager which is created with no arguments. Such as shared manager or init. Defaults to nil. Means using `SDWebImageDownloader.sharedDownloader` */ -@property (nonatomic, class, nullable) id defaultImageLoader; +@property (nonatomic, class, nullable) id defaultImageLoader; /** * Returns global shared manager instance. @@ -175,7 +174,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; * Allows to specify instance of cache and image loader used with image manager. * @return new instance of `SDWebImageManager` with specified cache and loader. */ -- (nonnull instancetype)initWithCache:(nonnull id)cache loader:(nonnull id)loader NS_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithCache:(nonnull id)cache loader:(nonnull id)loader NS_DESIGNATED_INITIALIZER; /** * Downloads the image at the given URL if not present in cache or return the cached version otherwise. @@ -204,7 +203,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; */ - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock; /** @@ -222,7 +221,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager]; - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock; /** diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 6d1f9d0d..e4dd08b8 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -8,16 +8,15 @@ #import "SDWebImageManager.h" #import "SDImageCache.h" -#import "NSImage+Compatibility.h" +#import "SDWebImageDownloader.h" #import "UIImage+WebCache.h" -#import "SDAnimatedImage.h" #import "SDWebImageError.h" #define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); #define UNLOCK(lock) dispatch_semaphore_signal(lock); static id _defaultImageCache; -static id _defaultImageLoader; +static id _defaultImageLoader; @interface SDWebImageCombinedOperation () @@ -31,7 +30,7 @@ static id _defaultImageLoader; @interface SDWebImageManager () @property (strong, nonatomic, readwrite, nonnull) SDImageCache *imageCache; -@property (strong, nonatomic, readwrite, nonnull) id imageLoader; +@property (strong, nonatomic, readwrite, nonnull) id imageLoader; @property (strong, nonatomic, nonnull) NSMutableSet *failedURLs; @property (strong, nonatomic, nonnull) dispatch_semaphore_t failedURLsLock; // a lock to keep the access to `failedURLs` thread-safe @property (strong, nonatomic, nonnull) NSMutableArray *runningOperations; @@ -52,12 +51,12 @@ static id _defaultImageLoader; _defaultImageCache = defaultImageCache; } -+ (id)defaultImageLoader { ++ (id)defaultImageLoader { return _defaultImageLoader; } -+ (void)setDefaultImageLoader:(id)defaultImageLoader { - if (defaultImageLoader && ![defaultImageLoader conformsToProtocol:@protocol(SDWebImageLoader)]) { ++ (void)setDefaultImageLoader:(id)defaultImageLoader { + if (defaultImageLoader && ![defaultImageLoader conformsToProtocol:@protocol(SDImageLoader)]) { return; } _defaultImageLoader = defaultImageLoader; @@ -77,14 +76,14 @@ static id _defaultImageLoader; if (!cache) { cache = [SDImageCache sharedImageCache]; } - id loader = [[self class] defaultImageLoader]; + id loader = [[self class] defaultImageLoader]; if (!loader) { loader = [SDWebImageDownloader sharedDownloader]; } return [self initWithCache:cache loader:loader]; } -- (nonnull instancetype)initWithCache:(nonnull id)cache loader:(nonnull id)loader { +- (nonnull instancetype)initWithCache:(nonnull id)cache loader:(nonnull id)loader { if ((self = [super init])) { _imageCache = cache; _imageLoader = loader; @@ -116,14 +115,14 @@ static id _defaultImageLoader; return SDScaledImageForKey(key, image); } -- (SDWebImageCombinedOperation *)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDInternalCompletionBlock)completedBlock { +- (SDWebImageCombinedOperation *)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDInternalCompletionBlock)completedBlock { return [self loadImageWithURL:url options:options context:nil progress:progressBlock completed:completedBlock]; } - (SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nonnull SDInternalCompletionBlock)completedBlock { // Invoking this method without a completedBlock is pointless NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); @@ -188,7 +187,7 @@ static id _defaultImageLoader; url:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { // Check whether we should query cache BOOL shouldQueryCache = (options & SDWebImageFromLoaderOnly) == 0; @@ -218,7 +217,7 @@ static id _defaultImageLoader; cachedImage:(nullable UIImage *)cachedImage cachedData:(nullable NSData *)cachedData cacheType:(SDImageCacheType)cacheType - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { // Check whether we should download image from network BOOL shouldDownload = (options & SDWebImageFromCacheOnly) == 0; diff --git a/SDWebImage/UIButton+WebCache.h b/SDWebImage/UIButton+WebCache.h index 0dea5b7a..b10e3097 100644 --- a/SDWebImage/UIButton+WebCache.h +++ b/SDWebImage/UIButton+WebCache.h @@ -149,7 +149,7 @@ forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -175,7 +175,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Background Image @@ -308,7 +308,7 @@ forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -333,7 +333,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #pragma mark - Cancel diff --git a/SDWebImage/UIButton+WebCache.m b/SDWebImage/UIButton+WebCache.m index 9df79587..9fd576af 100644 --- a/SDWebImage/UIButton+WebCache.m +++ b/SDWebImage/UIButton+WebCache.m @@ -76,7 +76,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -85,7 +85,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { if (!url) { [self.sd_imageURLStorage removeObjectForKey:imageURLKeyForState(state)]; @@ -156,7 +156,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; } -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 context:nil progress:progressBlock completed:completedBlock]; } @@ -165,7 +165,7 @@ static inline NSString * backgroundImageOperationKeyForState(UIControlState stat placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { if (!url) { [self.sd_imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)]; diff --git a/SDWebImage/UIImageView+HighlightedWebCache.h b/SDWebImage/UIImageView+HighlightedWebCache.h index c806e5f2..a29782ba 100644 --- a/SDWebImage/UIImageView+HighlightedWebCache.h +++ b/SDWebImage/UIImageView+HighlightedWebCache.h @@ -86,7 +86,7 @@ */ - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; @end diff --git a/SDWebImage/UIImageView+HighlightedWebCache.m b/SDWebImage/UIImageView+HighlightedWebCache.m index e4dd3a51..9cc34fb8 100644 --- a/SDWebImage/UIImageView+HighlightedWebCache.m +++ b/SDWebImage/UIImageView+HighlightedWebCache.m @@ -33,14 +33,14 @@ static NSString * const SDHighlightedImageOperationKey = @"UIImageViewImageOpera [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; } -- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { +- (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock { [self sd_setHighlightedImageWithURL:url options:options context:nil progress:progressBlock completed:completedBlock]; } - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { __weak typeof(self)weakSelf = self; SDWebImageMutableContext *mutableContext; diff --git a/SDWebImage/UIImageView+WebCache.h b/SDWebImage/UIImageView+WebCache.h index 1347f18d..c732b21c 100644 --- a/SDWebImage/UIImageView+WebCache.h +++ b/SDWebImage/UIImageView+WebCache.h @@ -148,7 +148,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; /** @@ -172,7 +172,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock; #if SD_UIKIT diff --git a/SDWebImage/UIImageView+WebCache.m b/SDWebImage/UIImageView+WebCache.m index 63c19239..9ad97aed 100644 --- a/SDWebImage/UIImageView+WebCache.m +++ b/SDWebImage/UIImageView+WebCache.m @@ -37,7 +37,7 @@ [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; } -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { +- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_setImageWithURL:url placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock]; } @@ -45,7 +45,7 @@ placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { [self sd_internalSetImageWithURL:url placeholderImage:placeholder diff --git a/SDWebImage/UIView+WebCache.h b/SDWebImage/UIView+WebCache.h index d674d9a1..10a383d3 100644 --- a/SDWebImage/UIView+WebCache.h +++ b/SDWebImage/UIView+WebCache.h @@ -66,7 +66,7 @@ typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable ima options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock; /** diff --git a/SDWebImage/UIView+WebCache.m b/SDWebImage/UIView+WebCache.m index dfe1ae7b..b2b3f4c5 100644 --- a/SDWebImage/UIView+WebCache.m +++ b/SDWebImage/UIView+WebCache.m @@ -40,7 +40,9 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL; placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context - setImageBlock:(nullable SDSetImageBlock)setImageBlock progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDInternalCompletionBlock)completedBlock { + setImageBlock:(nullable SDSetImageBlock)setImageBlock + progress:(nullable SDImageLoaderProgressBlock)progressBlock + completed:(nullable SDInternalCompletionBlock)completedBlock { context = [context copy]; // copy to avoid mutable object NSString *validOperationKey = nil; if ([context valueForKey:SDWebImageContextSetImageOperationKey]) { @@ -90,7 +92,7 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL; } __weak __typeof(self)wself = self; - SDWebImageDownloaderProgressBlock combinedProgressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { + SDImageLoaderProgressBlock combinedProgressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { __strong __typeof (wself) sself = wself; NSProgress *imageProgress = sself.sd_imageProgress; imageProgress.totalUnitCount = expectedSize; diff --git a/Tests/Tests/SDWebImageDownloaderTests.m b/Tests/Tests/SDWebImageDownloaderTests.m index 1d2de6fa..e2cfe5d5 100644 --- a/Tests/Tests/SDWebImageDownloaderTests.m +++ b/Tests/Tests/SDWebImageDownloaderTests.m @@ -433,7 +433,7 @@ - (void)test31ThatLoadersManagerWorks { XCTestExpectation *expectation = [self expectationWithDescription:@"Loaders manager not works"]; NSURL *imageURL = [NSURL URLWithString:kTestJpegURL]; - [[SDWebImageLoadersManager sharedManager] loadImageWithURL:imageURL options:0 context:nil progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { + [[SDImageLoadersManager sharedManager] loadImageWithURL:imageURL options:0 context:nil progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { expect(targetURL).notTo.beNil(); } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { expect(error).to.beNil(); diff --git a/Tests/Tests/SDWebImageTestLoader.h b/Tests/Tests/SDWebImageTestLoader.h index 10250240..d6a3f5f9 100644 --- a/Tests/Tests/SDWebImageTestLoader.h +++ b/Tests/Tests/SDWebImageTestLoader.h @@ -8,9 +8,9 @@ */ #import -#import +#import // A really naive implementation of custom image loader using `NSURLSession` -@interface SDWebImageTestLoader : NSObject +@interface SDWebImageTestLoader : NSObject @end diff --git a/Tests/Tests/SDWebImageTestLoader.m b/Tests/Tests/SDWebImageTestLoader.m index 65165d73..c4da8e73 100644 --- a/Tests/Tests/SDWebImageTestLoader.m +++ b/Tests/Tests/SDWebImageTestLoader.m @@ -20,13 +20,13 @@ return YES; } -- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDWebImageLoaderProgressBlock)progressBlock completed:(SDWebImageLoaderCompletedBlock)completedBlock { +- (id)loadImageWithURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context progress:(SDImageLoaderProgressBlock)progressBlock completed:(SDImageLoaderCompletedBlock)completedBlock { NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (data) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ - UIImage *image = SDWebImageLoaderDecodeImageData(data, url, options, context); + UIImage *image = SDImageLoaderDecodeImageData(data, url, options, context); if (completedBlock) { completedBlock(image, data, nil, YES); } diff --git a/WebImage/SDWebImage.h b/WebImage/SDWebImage.h index 864ffb5f..4f9ba055 100644 --- a/WebImage/SDWebImage.h +++ b/WebImage/SDWebImage.h @@ -36,8 +36,8 @@ FOUNDATION_EXPORT const unsigned char WebImageVersionString[]; #import #import #import -#import -#import +#import +#import #import #import #import