Authored by Bogdan Poplauschi

WatchOS support - just added a target and the conditional compiling - seems to w…

…ork (pod lib lint works).
There is an issue, the SDWebImage watchOS target doesn't show the simulator, only Generic Device.
Also need to add some demo and test code.
@@ -3,6 +3,8 @@ Pod::Spec.new do |s| @@ -3,6 +3,8 @@ Pod::Spec.new do |s|
3 s.version = '3.8.1' 3 s.version = '3.8.1'
4 s.ios.deployment_target = '7.0' 4 s.ios.deployment_target = '7.0'
5 s.tvos.deployment_target = '9.0' 5 s.tvos.deployment_target = '9.0'
  6 + s.watchos.deployment_target = '2.0'
  7 +
6 s.license = 'MIT' 8 s.license = 'MIT'
7 s.summary = 'Asynchronous image downloader with cache support with an UIImageView category.' 9 s.summary = 'Asynchronous image downloader with cache support with an UIImageView category.'
8 s.homepage = 'https://github.com/rs/SDWebImage' 10 s.homepage = 'https://github.com/rs/SDWebImage'
@@ -36,7 +38,7 @@ Pod::Spec.new do |s| @@ -36,7 +38,7 @@ Pod::Spec.new do |s|
36 end 38 end
37 39
38 s.subspec 'GIF' do |gif| 40 s.subspec 'GIF' do |gif|
39 - gif.ios.deployment_target = '6.0' 41 + gif.ios.deployment_target = '7.0'
40 gif.source_files = 'SDWebImage/FLAnimatedImage/*.{h,m}' 42 gif.source_files = 'SDWebImage/FLAnimatedImage/*.{h,m}'
41 gif.dependency 'SDWebImage/Core' 43 gif.dependency 'SDWebImage/Core'
42 gif.dependency 'FLAnimatedImage', '~> 1.0' 44 gif.dependency 'FLAnimatedImage', '~> 1.0'
@@ -267,6 +267,40 @@ @@ -267,6 +267,40 @@
267 431739591CDFC8B70008FEB9 /* mux.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CC81998E60B007367ED /* mux.h */; }; 267 431739591CDFC8B70008FEB9 /* mux.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CC81998E60B007367ED /* mux.h */; };
268 4317395A1CDFC8B70008FEB9 /* mux_types.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CC91998E60B007367ED /* mux_types.h */; }; 268 4317395A1CDFC8B70008FEB9 /* mux_types.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CC91998E60B007367ED /* mux_types.h */; };
269 4317395B1CDFC8B70008FEB9 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CCA1998E60B007367ED /* types.h */; }; 269 4317395B1CDFC8B70008FEB9 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = DA577CCA1998E60B007367ED /* types.h */; };
  270 + 431BB68C1D06D2C1006A3455 /* SDWebImageDownloaderOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 530E49E416460AE2002868E7 /* SDWebImageDownloaderOperation.m */; };
  271 + 431BB68E1D06D2C1006A3455 /* SDWebImagePrefetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D92148C56230056699D /* SDWebImagePrefetcher.m */; };
  272 + 431BB6901D06D2C1006A3455 /* FLAnimatedImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 43CE75CF1CFE98E0006C64D0 /* FLAnimatedImageView+WebCache.m */; };
  273 + 431BB6921D06D2C1006A3455 /* NSData+ImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D5B9141188EE8DD006D06BD /* NSData+ImageContentType.m */; };
  274 + 431BB69A1D06D2C1006A3455 /* SDWebImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D8C148C56230056699D /* SDWebImageDownloader.m */; };
  275 + 431BB6A31D06D2C1006A3455 /* UIImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D96148C56230056699D /* UIImageView+WebCache.m */; };
  276 + 431BB6AA1D06D2C1006A3455 /* SDWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D8F148C56230056699D /* SDWebImageManager.m */; };
  277 + 431BB6AC1D06D2C1006A3455 /* SDWebImageCompat.m in Sources */ = {isa = PBXBuildFile; fileRef = 5340674F167780C40042B59E /* SDWebImageCompat.m */; };
  278 + 431BB6B11D06D2C1006A3455 /* UIView+WebCacheOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AB615302192DA24600A2D8E9 /* UIView+WebCacheOperation.m */; };
  279 + 431BB6B41D06D2C1006A3455 /* SDWebImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D8A148C56230056699D /* SDWebImageDecoder.m */; };
  280 + 431BB6B61D06D2C1006A3455 /* UIImage+WebP.m in Sources */ = {isa = PBXBuildFile; fileRef = 53EDFB921762547C00698166 /* UIImage+WebP.m */; };
  281 + 431BB6B91D06D2C1006A3455 /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D94148C56230056699D /* UIButton+WebCache.m */; };
  282 + 431BB6BD1D06D2C1006A3455 /* UIImage+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = A18A6CC6172DC28500419892 /* UIImage+GIF.m */; };
  283 + 431BB6C01D06D2C1006A3455 /* SDImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 53922D86148C56230056699D /* SDImageCache.m */; };
  284 + 431BB6C41D06D2C1006A3455 /* UIImage+MultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 53EDFB8917623F7C00698166 /* UIImage+MultiFormat.m */; };
  285 + 431BB6C71D06D2C1006A3455 /* UIImageView+HighlightedWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = ABBE71A618C43B4D00B75E91 /* UIImageView+HighlightedWebCache.m */; };
  286 + 431BB6D71D06D2C1006A3455 /* UIImage+WebP.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EDFB911762547C00698166 /* UIImage+WebP.h */; settings = {ATTRIBUTES = (Public, ); }; };
  287 + 431BB6D91D06D2C1006A3455 /* SDWebImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D8E148C56230056699D /* SDWebImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
  288 + 431BB6DC1D06D2C1006A3455 /* UIButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D93148C56230056699D /* UIButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
  289 + 431BB6DF1D06D2C1006A3455 /* FLAnimatedImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 43CE75CE1CFE98E0006C64D0 /* FLAnimatedImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
  290 + 431BB6E11D06D2C1006A3455 /* SDWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A2CAE031AB4BB5400B6BC39 /* SDWebImage.h */; settings = {ATTRIBUTES = (Public, ); }; };
  291 + 431BB6E21D06D2C1006A3455 /* UIImageView+HighlightedWebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = ABBE71A518C43B4D00B75E91 /* UIImageView+HighlightedWebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
  292 + 431BB6E31D06D2C1006A3455 /* SDImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D85148C56230056699D /* SDImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
  293 + 431BB6E61D06D2C1006A3455 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D95148C56230056699D /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
  294 + 431BB6E71D06D2C1006A3455 /* SDWebImageCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D88148C56230056699D /* SDWebImageCompat.h */; settings = {ATTRIBUTES = (Public, ); }; };
  295 + 431BB6E91D06D2C1006A3455 /* SDWebImageDownloaderOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 530E49E316460AE2002868E7 /* SDWebImageDownloaderOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
  296 + 431BB6EB1D06D2C1006A3455 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AB615301192DA24600A2D8E9 /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
  297 + 431BB6EE1D06D2C1006A3455 /* NSData+ImageContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D5B9140188EE8DD006D06BD /* NSData+ImageContentType.h */; settings = {ATTRIBUTES = (Public, ); }; };
  298 + 431BB6EF1D06D2C1006A3455 /* SDWebImagePrefetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D91148C56230056699D /* SDWebImagePrefetcher.h */; settings = {ATTRIBUTES = (Public, ); }; };
  299 + 431BB6F01D06D2C1006A3455 /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 530E49E71646388E002868E7 /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
  300 + 431BB6F61D06D2C1006A3455 /* UIImage+MultiFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EDFB8817623F7C00698166 /* UIImage+MultiFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
  301 + 431BB6F91D06D2C1006A3455 /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = A18A6CC5172DC28500419892 /* UIImage+GIF.h */; settings = {ATTRIBUTES = (Public, ); }; };
  302 + 431BB6FA1D06D2C1006A3455 /* SDWebImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D8B148C56230056699D /* SDWebImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; };
  303 + 431BB6FC1D06D2C1006A3455 /* SDWebImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D89148C56230056699D /* SDWebImageDecoder.h */; settings = {ATTRIBUTES = (Public, ); }; };
270 438096721CDFC08200DC626B /* MKAnnotationView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 535699B415113E7300A4C397 /* MKAnnotationView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 304 438096721CDFC08200DC626B /* MKAnnotationView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 535699B415113E7300A4C397 /* MKAnnotationView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
271 438096731CDFC08F00DC626B /* MKAnnotationView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 535699B515113E7300A4C397 /* MKAnnotationView+WebCache.m */; }; 305 438096731CDFC08F00DC626B /* MKAnnotationView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 535699B515113E7300A4C397 /* MKAnnotationView+WebCache.m */; };
272 438096741CDFC09C00DC626B /* UIImage+WebP.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EDFB911762547C00698166 /* UIImage+WebP.h */; settings = {ATTRIBUTES = (Public, ); }; }; 306 438096741CDFC09C00DC626B /* UIImage+WebP.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EDFB911762547C00698166 /* UIImage+WebP.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -359,6 +393,7 @@ @@ -359,6 +393,7 @@
359 393
360 /* Begin PBXFileReference section */ 394 /* Begin PBXFileReference section */
361 00733A4C1BC487C000A5A117 /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 395 00733A4C1BC487C000A5A117 /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; };
  396 + 431BB7031D06D2C1006A3455 /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; };
362 43CE75491CFE9427006C64D0 /* FLAnimatedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLAnimatedImage.h; sourceTree = "<group>"; }; 397 43CE75491CFE9427006C64D0 /* FLAnimatedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLAnimatedImage.h; sourceTree = "<group>"; };
363 43CE754A1CFE9427006C64D0 /* FLAnimatedImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLAnimatedImage.m; sourceTree = "<group>"; }; 398 43CE754A1CFE9427006C64D0 /* FLAnimatedImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLAnimatedImage.m; sourceTree = "<group>"; };
364 43CE754B1CFE9427006C64D0 /* FLAnimatedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLAnimatedImageView.h; sourceTree = "<group>"; }; 399 43CE754B1CFE9427006C64D0 /* FLAnimatedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLAnimatedImageView.h; sourceTree = "<group>"; };
@@ -491,6 +526,13 @@ @@ -491,6 +526,13 @@
491 ); 526 );
492 runOnlyForDeploymentPostprocessing = 0; 527 runOnlyForDeploymentPostprocessing = 0;
493 }; 528 };
  529 + 431BB6CA1D06D2C1006A3455 /* Frameworks */ = {
  530 + isa = PBXFrameworksBuildPhase;
  531 + buildActionMask = 2147483647;
  532 + files = (
  533 + );
  534 + runOnlyForDeploymentPostprocessing = 0;
  535 + };
494 4A2CADFB1AB4BB5300B6BC39 /* Frameworks */ = { 536 4A2CADFB1AB4BB5300B6BC39 /* Frameworks */ = {
495 isa = PBXFrameworksBuildPhase; 537 isa = PBXFrameworksBuildPhase;
496 buildActionMask = 2147483647; 538 buildActionMask = 2147483647;
@@ -574,6 +616,7 @@ @@ -574,6 +616,7 @@
574 53761325155AD0D5005750A4 /* libSDWebImage.a */, 616 53761325155AD0D5005750A4 /* libSDWebImage.a */,
575 4A2CADFF1AB4BB5300B6BC39 /* SDWebImage.framework */, 617 4A2CADFF1AB4BB5300B6BC39 /* SDWebImage.framework */,
576 00733A4C1BC487C000A5A117 /* SDWebImage.framework */, 618 00733A4C1BC487C000A5A117 /* SDWebImage.framework */,
  619 + 431BB7031D06D2C1006A3455 /* SDWebImage.framework */,
577 ); 620 );
578 name = Products; 621 name = Products;
579 sourceTree = "<group>"; 622 sourceTree = "<group>";
@@ -848,6 +891,31 @@ @@ -848,6 +891,31 @@
848 ); 891 );
849 runOnlyForDeploymentPostprocessing = 0; 892 runOnlyForDeploymentPostprocessing = 0;
850 }; 893 };
  894 + 431BB6CB1D06D2C1006A3455 /* Headers */ = {
  895 + isa = PBXHeadersBuildPhase;
  896 + buildActionMask = 2147483647;
  897 + files = (
  898 + 431BB6D71D06D2C1006A3455 /* UIImage+WebP.h in Headers */,
  899 + 431BB6D91D06D2C1006A3455 /* SDWebImageManager.h in Headers */,
  900 + 431BB6DC1D06D2C1006A3455 /* UIButton+WebCache.h in Headers */,
  901 + 431BB6DF1D06D2C1006A3455 /* FLAnimatedImageView+WebCache.h in Headers */,
  902 + 431BB6E11D06D2C1006A3455 /* SDWebImage.h in Headers */,
  903 + 431BB6E21D06D2C1006A3455 /* UIImageView+HighlightedWebCache.h in Headers */,
  904 + 431BB6E31D06D2C1006A3455 /* SDImageCache.h in Headers */,
  905 + 431BB6E61D06D2C1006A3455 /* UIImageView+WebCache.h in Headers */,
  906 + 431BB6E71D06D2C1006A3455 /* SDWebImageCompat.h in Headers */,
  907 + 431BB6E91D06D2C1006A3455 /* SDWebImageDownloaderOperation.h in Headers */,
  908 + 431BB6EB1D06D2C1006A3455 /* UIView+WebCacheOperation.h in Headers */,
  909 + 431BB6EE1D06D2C1006A3455 /* NSData+ImageContentType.h in Headers */,
  910 + 431BB6EF1D06D2C1006A3455 /* SDWebImagePrefetcher.h in Headers */,
  911 + 431BB6F01D06D2C1006A3455 /* SDWebImageOperation.h in Headers */,
  912 + 431BB6F61D06D2C1006A3455 /* UIImage+MultiFormat.h in Headers */,
  913 + 431BB6F91D06D2C1006A3455 /* UIImage+GIF.h in Headers */,
  914 + 431BB6FA1D06D2C1006A3455 /* SDWebImageDownloader.h in Headers */,
  915 + 431BB6FC1D06D2C1006A3455 /* SDWebImageDecoder.h in Headers */,
  916 + );
  917 + runOnlyForDeploymentPostprocessing = 0;
  918 + };
851 4A2CADFC1AB4BB5300B6BC39 /* Headers */ = { 919 4A2CADFC1AB4BB5300B6BC39 /* Headers */ = {
852 isa = PBXHeadersBuildPhase; 920 isa = PBXHeadersBuildPhase;
853 buildActionMask = 2147483647; 921 buildActionMask = 2147483647;
@@ -986,6 +1054,24 @@ @@ -986,6 +1054,24 @@
986 productReference = 00733A4C1BC487C000A5A117 /* SDWebImage.framework */; 1054 productReference = 00733A4C1BC487C000A5A117 /* SDWebImage.framework */;
987 productType = "com.apple.product-type.framework"; 1055 productType = "com.apple.product-type.framework";
988 }; 1056 };
  1057 + 431BB6891D06D2C1006A3455 /* SDWebImage watchOS */ = {
  1058 + isa = PBXNativeTarget;
  1059 + buildConfigurationList = 431BB7001D06D2C1006A3455 /* Build configuration list for PBXNativeTarget "SDWebImage watchOS" */;
  1060 + buildPhases = (
  1061 + 431BB68A1D06D2C1006A3455 /* Sources */,
  1062 + 431BB6CA1D06D2C1006A3455 /* Frameworks */,
  1063 + 431BB6CB1D06D2C1006A3455 /* Headers */,
  1064 + 431BB6FF1D06D2C1006A3455 /* Resources */,
  1065 + );
  1066 + buildRules = (
  1067 + );
  1068 + dependencies = (
  1069 + );
  1070 + name = "SDWebImage watchOS";
  1071 + productName = "WebImage tvOS";
  1072 + productReference = 431BB7031D06D2C1006A3455 /* SDWebImage.framework */;
  1073 + productType = "com.apple.product-type.framework";
  1074 + };
989 4A2CADFE1AB4BB5300B6BC39 /* SDWebImage iOS */ = { 1075 4A2CADFE1AB4BB5300B6BC39 /* SDWebImage iOS */ = {
990 isa = PBXNativeTarget; 1076 isa = PBXNativeTarget;
991 buildConfigurationList = 4A2CAE121AB4BB5400B6BC39 /* Build configuration list for PBXNativeTarget "SDWebImage iOS" */; 1077 buildConfigurationList = 4A2CAE121AB4BB5400B6BC39 /* Build configuration list for PBXNativeTarget "SDWebImage iOS" */;
@@ -1054,6 +1140,7 @@ @@ -1054,6 +1140,7 @@
1054 53761307155AD0D5005750A4 /* SDWebImage */, 1140 53761307155AD0D5005750A4 /* SDWebImage */,
1055 4A2CADFE1AB4BB5300B6BC39 /* SDWebImage iOS */, 1141 4A2CADFE1AB4BB5300B6BC39 /* SDWebImage iOS */,
1056 00733A4B1BC487C000A5A117 /* SDWebImage tvOS */, 1142 00733A4B1BC487C000A5A117 /* SDWebImage tvOS */,
  1143 + 431BB6891D06D2C1006A3455 /* SDWebImage watchOS */,
1057 ); 1144 );
1058 }; 1145 };
1059 /* End PBXProject section */ 1146 /* End PBXProject section */
@@ -1066,6 +1153,13 @@ @@ -1066,6 +1153,13 @@
1066 ); 1153 );
1067 runOnlyForDeploymentPostprocessing = 0; 1154 runOnlyForDeploymentPostprocessing = 0;
1068 }; 1155 };
  1156 + 431BB6FF1D06D2C1006A3455 /* Resources */ = {
  1157 + isa = PBXResourcesBuildPhase;
  1158 + buildActionMask = 2147483647;
  1159 + files = (
  1160 + );
  1161 + runOnlyForDeploymentPostprocessing = 0;
  1162 + };
1069 4A2CADFD1AB4BB5300B6BC39 /* Resources */ = { 1163 4A2CADFD1AB4BB5300B6BC39 /* Resources */ = {
1070 isa = PBXResourcesBuildPhase; 1164 isa = PBXResourcesBuildPhase;
1071 buildActionMask = 2147483647; 1165 buildActionMask = 2147483647;
@@ -1163,6 +1257,29 @@ @@ -1163,6 +1257,29 @@
1163 ); 1257 );
1164 runOnlyForDeploymentPostprocessing = 0; 1258 runOnlyForDeploymentPostprocessing = 0;
1165 }; 1259 };
  1260 + 431BB68A1D06D2C1006A3455 /* Sources */ = {
  1261 + isa = PBXSourcesBuildPhase;
  1262 + buildActionMask = 2147483647;
  1263 + files = (
  1264 + 431BB68C1D06D2C1006A3455 /* SDWebImageDownloaderOperation.m in Sources */,
  1265 + 431BB68E1D06D2C1006A3455 /* SDWebImagePrefetcher.m in Sources */,
  1266 + 431BB6901D06D2C1006A3455 /* FLAnimatedImageView+WebCache.m in Sources */,
  1267 + 431BB6921D06D2C1006A3455 /* NSData+ImageContentType.m in Sources */,
  1268 + 431BB69A1D06D2C1006A3455 /* SDWebImageDownloader.m in Sources */,
  1269 + 431BB6A31D06D2C1006A3455 /* UIImageView+WebCache.m in Sources */,
  1270 + 431BB6AA1D06D2C1006A3455 /* SDWebImageManager.m in Sources */,
  1271 + 431BB6AC1D06D2C1006A3455 /* SDWebImageCompat.m in Sources */,
  1272 + 431BB6B11D06D2C1006A3455 /* UIView+WebCacheOperation.m in Sources */,
  1273 + 431BB6B41D06D2C1006A3455 /* SDWebImageDecoder.m in Sources */,
  1274 + 431BB6B61D06D2C1006A3455 /* UIImage+WebP.m in Sources */,
  1275 + 431BB6B91D06D2C1006A3455 /* UIButton+WebCache.m in Sources */,
  1276 + 431BB6BD1D06D2C1006A3455 /* UIImage+GIF.m in Sources */,
  1277 + 431BB6C01D06D2C1006A3455 /* SDImageCache.m in Sources */,
  1278 + 431BB6C41D06D2C1006A3455 /* UIImage+MultiFormat.m in Sources */,
  1279 + 431BB6C71D06D2C1006A3455 /* UIImageView+HighlightedWebCache.m in Sources */,
  1280 + );
  1281 + runOnlyForDeploymentPostprocessing = 0;
  1282 + };
1166 4A2CADFA1AB4BB5300B6BC39 /* Sources */ = { 1283 4A2CADFA1AB4BB5300B6BC39 /* Sources */ = {
1167 isa = PBXSourcesBuildPhase; 1284 isa = PBXSourcesBuildPhase;
1168 buildActionMask = 2147483647; 1285 buildActionMask = 2147483647;
@@ -1321,7 +1438,6 @@ @@ -1321,7 +1438,6 @@
1321 ENABLE_TESTABILITY = YES; 1438 ENABLE_TESTABILITY = YES;
1322 GCC_NO_COMMON_BLOCKS = YES; 1439 GCC_NO_COMMON_BLOCKS = YES;
1323 INFOPLIST_FILE = WebImage/Info.plist; 1440 INFOPLIST_FILE = WebImage/Info.plist;
1324 - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";  
1325 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1441 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1326 MTL_ENABLE_DEBUG_INFO = YES; 1442 MTL_ENABLE_DEBUG_INFO = YES;
1327 PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).tvos"; 1443 PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).tvos";
@@ -1350,7 +1466,6 @@ @@ -1350,7 +1466,6 @@
1350 ENABLE_STRICT_OBJC_MSGSEND = YES; 1466 ENABLE_STRICT_OBJC_MSGSEND = YES;
1351 GCC_NO_COMMON_BLOCKS = YES; 1467 GCC_NO_COMMON_BLOCKS = YES;
1352 INFOPLIST_FILE = WebImage/Info.plist; 1468 INFOPLIST_FILE = WebImage/Info.plist;
1353 - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";  
1354 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1469 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1355 MTL_ENABLE_DEBUG_INFO = NO; 1470 MTL_ENABLE_DEBUG_INFO = NO;
1356 PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).tvos"; 1471 PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).tvos";
@@ -1364,6 +1479,62 @@ @@ -1364,6 +1479,62 @@
1364 }; 1479 };
1365 name = Release; 1480 name = Release;
1366 }; 1481 };
  1482 + 431BB7011D06D2C1006A3455 /* Debug */ = {
  1483 + isa = XCBuildConfiguration;
  1484 + buildSettings = {
  1485 + CURRENT_PROJECT_VERSION = 1;
  1486 + DEBUG_INFORMATION_FORMAT = dwarf;
  1487 + DEFINES_MODULE = YES;
  1488 + DYLIB_COMPATIBILITY_VERSION = 1;
  1489 + DYLIB_CURRENT_VERSION = 1;
  1490 + DYLIB_INSTALL_NAME_BASE = "@rpath";
  1491 + ENABLE_STRICT_OBJC_MSGSEND = YES;
  1492 + ENABLE_TESTABILITY = YES;
  1493 + GCC_NO_COMMON_BLOCKS = YES;
  1494 + INFOPLIST_FILE = WebImage/Info.plist;
  1495 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
  1496 + MTL_ENABLE_DEBUG_INFO = YES;
  1497 + PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).watchos";
  1498 + PRODUCT_NAME = SDWebImage;
  1499 + SDKROOT = watchos;
  1500 + SKIP_INSTALL = YES;
  1501 + SUPPORTED_PLATFORMS = "watchsimulator watchos";
  1502 + SWIFT_OPTIMIZATION_LEVEL = "-Onone";
  1503 + TARGETED_DEVICE_FAMILY = 3;
  1504 + VERSIONING_SYSTEM = "apple-generic";
  1505 + VERSION_INFO_PREFIX = "";
  1506 + WATCHOS_DEPLOYMENT_TARGET = 2.0;
  1507 + };
  1508 + name = Debug;
  1509 + };
  1510 + 431BB7021D06D2C1006A3455 /* Release */ = {
  1511 + isa = XCBuildConfiguration;
  1512 + buildSettings = {
  1513 + COPY_PHASE_STRIP = NO;
  1514 + CURRENT_PROJECT_VERSION = 1;
  1515 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
  1516 + DEFINES_MODULE = YES;
  1517 + DYLIB_COMPATIBILITY_VERSION = 1;
  1518 + DYLIB_CURRENT_VERSION = 1;
  1519 + DYLIB_INSTALL_NAME_BASE = "@rpath";
  1520 + ENABLE_NS_ASSERTIONS = NO;
  1521 + ENABLE_STRICT_OBJC_MSGSEND = YES;
  1522 + GCC_NO_COMMON_BLOCKS = YES;
  1523 + INFOPLIST_FILE = WebImage/Info.plist;
  1524 + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
  1525 + MTL_ENABLE_DEBUG_INFO = NO;
  1526 + PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.$(PRODUCT_NAME:rfc1034identifier).watchos";
  1527 + PRODUCT_NAME = SDWebImage;
  1528 + SDKROOT = watchos;
  1529 + SKIP_INSTALL = YES;
  1530 + SUPPORTED_PLATFORMS = "watchsimulator watchos";
  1531 + TARGETED_DEVICE_FAMILY = 3;
  1532 + VERSIONING_SYSTEM = "apple-generic";
  1533 + VERSION_INFO_PREFIX = "";
  1534 + WATCHOS_DEPLOYMENT_TARGET = 2.0;
  1535 + };
  1536 + name = Release;
  1537 + };
1367 4A2CAE131AB4BB5400B6BC39 /* Debug */ = { 1538 4A2CAE131AB4BB5400B6BC39 /* Debug */ = {
1368 isa = XCBuildConfiguration; 1539 isa = XCBuildConfiguration;
1369 buildSettings = { 1540 buildSettings = {
@@ -1450,7 +1621,6 @@ @@ -1450,7 +1621,6 @@
1450 GCC_OPTIMIZATION_LEVEL = 0; 1621 GCC_OPTIMIZATION_LEVEL = 0;
1451 GCC_PREPROCESSOR_DEFINITIONS = ( 1622 GCC_PREPROCESSOR_DEFINITIONS = (
1452 "DEBUG=1", 1623 "DEBUG=1",
1453 - "SD_WEBP=1",  
1454 "$(inherited)", 1624 "$(inherited)",
1455 ); 1625 );
1456 GCC_SYMBOLS_PRIVATE_EXTERN = NO; 1626 GCC_SYMBOLS_PRIVATE_EXTERN = NO;
@@ -1506,10 +1676,7 @@ @@ -1506,10 +1676,7 @@
1506 ); 1676 );
1507 GCC_C_LANGUAGE_STANDARD = gnu99; 1677 GCC_C_LANGUAGE_STANDARD = gnu99;
1508 GCC_NO_COMMON_BLOCKS = YES; 1678 GCC_NO_COMMON_BLOCKS = YES;
1509 - GCC_PREPROCESSOR_DEFINITIONS = (  
1510 - "SD_WEBP=1",  
1511 - "$(inherited)",  
1512 - ); 1679 + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
1513 GCC_TREAT_WARNINGS_AS_ERRORS = NO; 1680 GCC_TREAT_WARNINGS_AS_ERRORS = NO;
1514 GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1681 GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1515 GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; 1682 GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
@@ -1548,6 +1715,15 @@ @@ -1548,6 +1715,15 @@
1548 defaultConfigurationIsVisible = 0; 1715 defaultConfigurationIsVisible = 0;
1549 defaultConfigurationName = Release; 1716 defaultConfigurationName = Release;
1550 }; 1717 };
  1718 + 431BB7001D06D2C1006A3455 /* Build configuration list for PBXNativeTarget "SDWebImage watchOS" */ = {
  1719 + isa = XCConfigurationList;
  1720 + buildConfigurations = (
  1721 + 431BB7011D06D2C1006A3455 /* Debug */,
  1722 + 431BB7021D06D2C1006A3455 /* Release */,
  1723 + );
  1724 + defaultConfigurationIsVisible = 0;
  1725 + defaultConfigurationName = Release;
  1726 + };
1551 4A2CAE121AB4BB5400B6BC39 /* Build configuration list for PBXNativeTarget "SDWebImage iOS" */ = { 1727 4A2CAE121AB4BB5400B6BC39 /* Build configuration list for PBXNativeTarget "SDWebImage iOS" */ = {
1552 isa = XCConfigurationList; 1728 isa = XCConfigurationList;
1553 buildConfigurations = ( 1729 buildConfigurations = (
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Scheme
  3 + LastUpgradeVersion = "0730"
  4 + version = "1.3">
  5 + <BuildAction
  6 + parallelizeBuildables = "YES"
  7 + buildImplicitDependencies = "YES">
  8 + <BuildActionEntries>
  9 + <BuildActionEntry
  10 + buildForTesting = "YES"
  11 + buildForRunning = "YES"
  12 + buildForProfiling = "YES"
  13 + buildForArchiving = "YES"
  14 + buildForAnalyzing = "YES">
  15 + <BuildableReference
  16 + BuildableIdentifier = "primary"
  17 + BlueprintIdentifier = "431BB6891D06D2C1006A3455"
  18 + BuildableName = "SDWebImage.framework"
  19 + BlueprintName = "SDWebImage watchOS"
  20 + ReferencedContainer = "container:SDWebImage.xcodeproj">
  21 + </BuildableReference>
  22 + </BuildActionEntry>
  23 + </BuildActionEntries>
  24 + </BuildAction>
  25 + <TestAction
  26 + buildConfiguration = "Debug"
  27 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  28 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  29 + shouldUseLaunchSchemeArgsEnv = "YES">
  30 + <Testables>
  31 + </Testables>
  32 + <AdditionalOptions>
  33 + </AdditionalOptions>
  34 + </TestAction>
  35 + <LaunchAction
  36 + buildConfiguration = "Debug"
  37 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  38 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  39 + launchStyle = "0"
  40 + useCustomWorkingDirectory = "NO"
  41 + ignoresPersistentStateOnLaunch = "NO"
  42 + debugDocumentVersioning = "YES"
  43 + debugServiceExtension = "internal"
  44 + allowLocationSimulation = "YES">
  45 + <MacroExpansion>
  46 + <BuildableReference
  47 + BuildableIdentifier = "primary"
  48 + BlueprintIdentifier = "431BB6891D06D2C1006A3455"
  49 + BuildableName = "SDWebImage.framework"
  50 + BlueprintName = "SDWebImage watchOS"
  51 + ReferencedContainer = "container:SDWebImage.xcodeproj">
  52 + </BuildableReference>
  53 + </MacroExpansion>
  54 + <AdditionalOptions>
  55 + </AdditionalOptions>
  56 + </LaunchAction>
  57 + <ProfileAction
  58 + buildConfiguration = "Release"
  59 + shouldUseLaunchSchemeArgsEnv = "YES"
  60 + savedToolIdentifier = ""
  61 + useCustomWorkingDirectory = "NO"
  62 + debugDocumentVersioning = "YES">
  63 + <MacroExpansion>
  64 + <BuildableReference
  65 + BuildableIdentifier = "primary"
  66 + BlueprintIdentifier = "431BB6891D06D2C1006A3455"
  67 + BuildableName = "SDWebImage.framework"
  68 + BlueprintName = "SDWebImage watchOS"
  69 + ReferencedContainer = "container:SDWebImage.xcodeproj">
  70 + </BuildableReference>
  71 + </MacroExpansion>
  72 + </ProfileAction>
  73 + <AnalyzeAction
  74 + buildConfiguration = "Debug">
  75 + </AnalyzeAction>
  76 + <ArchiveAction
  77 + buildConfiguration = "Release"
  78 + revealArchiveInOrganizer = "YES">
  79 + </ArchiveAction>
  80 +</Scheme>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
  6 + <false/>
  7 +</dict>
  8 +</plist>
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 * file that was distributed with this source code. 6 * file that was distributed with this source code.
7 */ 7 */
8 8
  9 +#if TARGET_OS_IOS || TARGET_OS_TV
9 10
10 #if COCOAPODS 11 #if COCOAPODS
11 @import FLAnimatedImage; 12 @import FLAnimatedImage;
@@ -139,3 +140,5 @@ @@ -139,3 +140,5 @@
139 - (void)sd_cancelCurrentImageLoad; 140 - (void)sd_cancelCurrentImageLoad;
140 141
141 @end 142 @end
  143 +
  144 +#endif
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 * file that was distributed with this source code. 6 * file that was distributed with this source code.
7 */ 7 */
8 8
  9 +#if TARGET_OS_IOS || TARGET_OS_TV
9 10
10 #import "FLAnimatedImageView+WebCache.h" 11 #import "FLAnimatedImageView+WebCache.h"
11 #import "objc/runtime.h" 12 #import "objc/runtime.h"
@@ -117,3 +118,5 @@ static char imageURLKey; @@ -117,3 +118,5 @@ static char imageURLKey;
117 118
118 119
119 @end 120 @end
  121 +
  122 +#endif
@@ -21,14 +21,17 @@ @@ -21,14 +21,17 @@
21 - (nonnull instancetype)init { 21 - (nonnull instancetype)init {
22 self = [super init]; 22 self = [super init];
23 if (self) { 23 if (self) {
  24 +#if TARGET_OS_IOS || TARGET_OS_TV
24 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 25 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
  26 +#endif
25 } 27 }
26 return self; 28 return self;
27 } 29 }
28 30
29 - (void)dealloc { 31 - (void)dealloc {
  32 +#if TARGET_OS_IOS || TARGET_OS_TV
30 [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 33 [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
31 - 34 +#endif
32 } 35 }
33 36
34 @end 37 @end
@@ -126,7 +129,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -126,7 +129,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
126 _fileManager = [NSFileManager new]; 129 _fileManager = [NSFileManager new];
127 }); 130 });
128 131
129 -#if TARGET_OS_IOS 132 +#if TARGET_OS_IOS || TARGET_OS_TV
130 // Subscribe to app events 133 // Subscribe to app events
131 [[NSNotificationCenter defaultCenter] addObserver:self 134 [[NSNotificationCenter defaultCenter] addObserver:self
132 selector:@selector(clearMemory) 135 selector:@selector(clearMemory)
@@ -211,7 +214,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -211,7 +214,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
211 NSData *data = imageData; 214 NSData *data = imageData;
212 215
213 if (image && (recalculate || !data)) { 216 if (image && (recalculate || !data)) {
214 -#if TARGET_OS_IPHONE 217 +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
215 // We need to determine if the image is a PNG or a JPEG 218 // We need to determine if the image is a PNG or a JPEG
216 // PNGs are easier to detect because they have a unique signature (http://www.w3.org/TR/PNG-Structure.html) 219 // PNGs are easier to detect because they have a unique signature (http://www.w3.org/TR/PNG-Structure.html)
217 // The first eight bytes of a PNG file always contain the following (decimal) values: 220 // The first eight bytes of a PNG file always contain the following (decimal) values:
@@ -589,6 +592,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -589,6 +592,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
589 }); 592 });
590 } 593 }
591 594
  595 +#if TARGET_OS_IOS || TARGET_OS_TV
592 - (void)backgroundCleanDisk { 596 - (void)backgroundCleanDisk {
593 Class UIApplicationClass = NSClassFromString(@"UIApplication"); 597 Class UIApplicationClass = NSClassFromString(@"UIApplication");
594 if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { 598 if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) {
@@ -608,6 +612,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -608,6 +612,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
608 bgTask = UIBackgroundTaskInvalid; 612 bgTask = UIBackgroundTaskInvalid;
609 }]; 613 }];
610 } 614 }
  615 +#endif
611 616
612 - (NSUInteger)getSize { 617 - (NSUInteger)getSize {
613 __block NSUInteger size = 0; 618 __block NSUInteger size = 0;
@@ -18,17 +18,18 @@ @@ -18,17 +18,18 @@
18 #endif 18 #endif
19 19
20 #if !TARGET_OS_IPHONE 20 #if !TARGET_OS_IPHONE
21 -#import <AppKit/AppKit.h>  
22 -#ifndef UIImage  
23 -#define UIImage NSImage  
24 -#endif  
25 -#ifndef UIImageView  
26 -#define UIImageView NSImageView  
27 -#endif 21 + #import <AppKit/AppKit.h>
  22 + #ifndef UIImage
  23 + #define UIImage NSImage
  24 + #endif
  25 + #ifndef UIImageView
  26 + #define UIImageView NSImageView
  27 + #endif
28 #else 28 #else
29 -  
30 -#import <UIKit/UIKit.h>  
31 - 29 + #import <UIKit/UIKit.h>
  30 + #if TARGET_OS_WATCH
  31 + #import <WatchKit/WatchKit.h>
  32 + #endif
32 #endif 33 #endif
33 34
34 #ifndef NS_ENUM 35 #ifndef NS_ENUM
@@ -27,7 +27,11 @@ inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullabl @@ -27,7 +27,11 @@ inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullabl
27 return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 27 return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
28 } 28 }
29 else { 29 else {
  30 +#if TARGET_OS_WATCH
  31 + if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) {
  32 +#else
30 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 33 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
  34 +#endif
31 CGFloat scale = 1; 35 CGFloat scale = 1;
32 if (key.length >= 8) { 36 if (key.length >= 8) {
33 NSRange range = [key rangeOfString:@"@2x."]; 37 NSRange range = [key rangeOfString:@"@2x."];
@@ -41,7 +41,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary; @@ -41,7 +41,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
41 @property (strong, atomic, nullable) NSThread *thread; 41 @property (strong, atomic, nullable) NSThread *thread;
42 @property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue; 42 @property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue;
43 43
44 -#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 44 +#if TARGET_OS_IOS || TARGET_OS_TV
45 @property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; 45 @property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId;
46 #endif 46 #endif
47 47
@@ -125,7 +125,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary; @@ -125,7 +125,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
125 return; 125 return;
126 } 126 }
127 127
128 -#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 128 +#if TARGET_OS_IOS || TARGET_OS_TV
129 Class UIApplicationClass = NSClassFromString(@"UIApplication"); 129 Class UIApplicationClass = NSClassFromString(@"UIApplication");
130 BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)]; 130 BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)];
131 if (hasApplication && [self shouldContinueWhenAppEntersBackground]) { 131 if (hasApplication && [self shouldContinueWhenAppEntersBackground]) {
@@ -179,7 +179,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary; @@ -179,7 +179,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
179 } 179 }
180 } 180 }
181 181
182 -#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 182 +#if TARGET_OS_IOS || TARGET_OS_TV
183 Class UIApplicationClass = NSClassFromString(@"UIApplication"); 183 Class UIApplicationClass = NSClassFromString(@"UIApplication");
184 if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { 184 if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) {
185 return; 185 return;
@@ -345,7 +345,7 @@ didReceiveResponse:(NSURLResponse *)response @@ -345,7 +345,7 @@ didReceiveResponse:(NSURLResponse *)response
345 // Create the image 345 // Create the image
346 CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL); 346 CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL);
347 347
348 -#ifdef TARGET_OS_IPHONE 348 +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
349 // Workaround for iOS anamorphic image 349 // Workaround for iOS anamorphic image
350 if (partialImageRef) { 350 if (partialImageRef) {
351 const size_t partialHeight = CGImageGetHeight(partialImageRef); 351 const size_t partialHeight = CGImageGetHeight(partialImageRef);
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #import "SDWebImageCompat.h" 9 #import "SDWebImageCompat.h"
10 #import "SDWebImageManager.h" 10 #import "SDWebImageManager.h"
11 11
  12 +#if TARGET_OS_IOS || TARGET_OS_TV
  13 +
12 /** 14 /**
13 * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. 15 * Integrates SDWebImage async downloading and caching of remote images with UIButtonView.
14 */ 16 */
@@ -230,3 +232,5 @@ @@ -230,3 +232,5 @@
230 - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; 232 - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state;
231 233
232 @end 234 @end
  235 +
  236 +#endif
@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 #import "objc/runtime.h" 10 #import "objc/runtime.h"
11 #import "UIView+WebCacheOperation.h" 11 #import "UIView+WebCacheOperation.h"
12 12
  13 +#if TARGET_OS_IOS || TARGET_OS_TV
  14 +
13 static char imageURLStorageKey; 15 static char imageURLStorageKey;
14 16
15 typedef NSMutableDictionary<NSNumber *, NSURL *> SDStateImageURLDictionary; 17 typedef NSMutableDictionary<NSNumber *, NSURL *> SDStateImageURLDictionary;
@@ -183,3 +185,5 @@ typedef NSMutableDictionary<NSNumber *, NSURL *> SDStateImageURLDictionary; @@ -183,3 +185,5 @@ typedef NSMutableDictionary<NSNumber *, NSURL *> SDStateImageURLDictionary;
183 } 185 }
184 186
185 @end 187 @end
  188 +
  189 +#endif
@@ -8,6 +8,9 @@ @@ -8,6 +8,9 @@
8 */ 8 */
9 9
10 #import <UIKit/UIKit.h> 10 #import <UIKit/UIKit.h>
  11 +#if TARGET_OS_WATCH
  12 + #import <WatchKit/WatchKit.h>
  13 +#endif
11 14
12 @interface UIImage (GIF) 15 @interface UIImage (GIF)
13 16
@@ -29,8 +29,16 @@ @@ -29,8 +29,16 @@
29 } else { 29 } else {
30 // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category. 30 // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category.
31 // this here is only code to allow drawing animated images as static ones 31 // this here is only code to allow drawing animated images as static ones
  32 + CGFloat scale = 1;
  33 +#if TARGET_OS_WATCH
  34 + scale = [WKInterfaceDevice currentDevice].screenScale;
  35 +#else
  36 + scale = [UIScreen mainScreen].scale;
  37 +#endif
  38 +
  39 +
32 CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); 40 CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL);
33 - UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]; 41 + UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp];
34 staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f]; 42 staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f];
35 CGImageRelease(CGImage); 43 CGImageRelease(CGImage);
36 } 44 }
@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 #import "SDWebImageCompat.h" 10 #import "SDWebImageCompat.h"
11 #import "SDWebImageManager.h" 11 #import "SDWebImageManager.h"
12 12
  13 +#if TARGET_OS_IOS || TARGET_OS_TV
  14 +
13 /** 15 /**
14 * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 16 * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state.
15 */ 17 */
@@ -92,3 +94,5 @@ @@ -92,3 +94,5 @@
92 - (void)sd_cancelCurrentHighlightedImageLoad; 94 - (void)sd_cancelCurrentHighlightedImageLoad;
93 95
94 @end 96 @end
  97 +
  98 +#endif
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #import "UIImageView+HighlightedWebCache.h" 9 #import "UIImageView+HighlightedWebCache.h"
10 #import "UIView+WebCacheOperation.h" 10 #import "UIView+WebCacheOperation.h"
11 11
  12 +#if TARGET_OS_IOS || TARGET_OS_TV
  13 +
12 #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 14 #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage"
13 15
14 @implementation UIImageView (HighlightedWebCache) 16 @implementation UIImageView (HighlightedWebCache)
@@ -71,3 +73,5 @@ @@ -71,3 +73,5 @@
71 } 73 }
72 74
73 @end 75 @end
  76 +
  77 +#endif
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #import "SDWebImageCompat.h" 9 #import "SDWebImageCompat.h"
10 #import "SDWebImageManager.h" 10 #import "SDWebImageManager.h"
11 11
  12 +#if TARGET_OS_IOS || TARGET_OS_TV
  13 +
12 /** 14 /**
13 * Integrates SDWebImage async downloading and caching of remote images with UIImageView. 15 * Integrates SDWebImage async downloading and caching of remote images with UIImageView.
14 * 16 *
@@ -211,3 +213,5 @@ @@ -211,3 +213,5 @@
211 213
212 214
213 @end 215 @end
  216 +
  217 +#endif
@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 #import "objc/runtime.h" 10 #import "objc/runtime.h"
11 #import "UIView+WebCacheOperation.h" 11 #import "UIView+WebCacheOperation.h"
12 12
  13 +#if TARGET_OS_IOS || TARGET_OS_TV
  14 +
13 static char imageURLKey; 15 static char imageURLKey;
14 static char TAG_ACTIVITY_INDICATOR; 16 static char TAG_ACTIVITY_INDICATOR;
15 static char TAG_ACTIVITY_STYLE; 17 static char TAG_ACTIVITY_STYLE;
@@ -218,3 +220,5 @@ static char TAG_ACTIVITY_SHOW; @@ -218,3 +220,5 @@ static char TAG_ACTIVITY_SHOW;
218 } 220 }
219 221
220 @end 222 @end
  223 +
  224 +#endif
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
10 #import "SDWebImageManager.h" 10 #import "SDWebImageManager.h"
11 11
  12 +#if TARGET_OS_IOS || TARGET_OS_TV
  13 +
12 @interface UIView (WebCacheOperation) 14 @interface UIView (WebCacheOperation)
13 15
14 /** 16 /**
@@ -34,3 +36,5 @@ @@ -34,3 +36,5 @@
34 - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 36 - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
35 37
36 @end 38 @end
  39 +
  40 +#endif
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #import "UIView+WebCacheOperation.h" 9 #import "UIView+WebCacheOperation.h"
10 #import "objc/runtime.h" 10 #import "objc/runtime.h"
11 11
  12 +#if TARGET_OS_IOS || TARGET_OS_TV
  13 +
12 static char loadOperationKey; 14 static char loadOperationKey;
13 15
14 typedef NSMutableDictionary<NSString *, id> SDOperationsDictionary; 16 typedef NSMutableDictionary<NSString *, id> SDOperationsDictionary;
@@ -59,3 +61,5 @@ typedef NSMutableDictionary<NSString *, id> SDOperationsDictionary; @@ -59,3 +61,5 @@ typedef NSMutableDictionary<NSString *, id> SDOperationsDictionary;
59 } 61 }
60 62
61 @end 63 @end
  64 +
  65 +#endif