diff --git a/Examples/SDWebImage Demo/AppDelegate.m b/Examples/SDWebImage Demo/AppDelegate.m index 74342347..c7454062 100644 --- a/Examples/SDWebImage Demo/AppDelegate.m +++ b/Examples/SDWebImage Demo/AppDelegate.m @@ -33,7 +33,10 @@ // iOS 13 does not supports WebP, use third-party codec [[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]]; } - [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; // For HEIC static/animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) { + // For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; + } self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; // Override point for customization after application launch. diff --git a/Examples/SDWebImage OSX Demo/AppDelegate.m b/Examples/SDWebImage OSX Demo/AppDelegate.m index 23aaee7f..f1c7e02b 100644 --- a/Examples/SDWebImage OSX Demo/AppDelegate.m +++ b/Examples/SDWebImage OSX Demo/AppDelegate.m @@ -26,7 +26,10 @@ // iOS 13 does not supports WebP, use third-party codec [[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]]; } - [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; // For HEIC static/animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) { + // For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; + } } - (void)applicationWillTerminate:(NSNotification *)aNotification { diff --git a/Examples/SDWebImage TV Demo/AppDelegate.m b/Examples/SDWebImage TV Demo/AppDelegate.m index bdb7c983..f14575ed 100644 --- a/Examples/SDWebImage TV Demo/AppDelegate.m +++ b/Examples/SDWebImage TV Demo/AppDelegate.m @@ -27,7 +27,10 @@ // iOS 13 does not supports WebP, use third-party codec [[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]]; } - [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; // For HEIC static/animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) { + // For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; + } return YES; } diff --git a/Examples/SDWebImage Watch Demo Extension/ExtensionDelegate.m b/Examples/SDWebImage Watch Demo Extension/ExtensionDelegate.m index c7e3716f..6ecfc197 100644 --- a/Examples/SDWebImage Watch Demo Extension/ExtensionDelegate.m +++ b/Examples/SDWebImage Watch Demo Extension/ExtensionDelegate.m @@ -22,7 +22,10 @@ // iOS 13 does not supports WebP, use third-party codec [[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]]; } - [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; // For HEIC static/animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) { + // For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now. + [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; + } } - (void)applicationDidBecomeActive { diff --git a/SDWebImage/Core/SDImageAWebPCoder.h b/SDWebImage/Core/SDImageAWebPCoder.h index f1221363..4b585a99 100644 --- a/SDWebImage/Core/SDImageAWebPCoder.h +++ b/SDWebImage/Core/SDImageAWebPCoder.h @@ -15,6 +15,7 @@ @note Currently Image/IO seems does not supports WebP encoding, if you need WebP encoding, use the custom codec below. @note If you need to support lower firmware version for WebP, you can have a try at https://github.com/SDWebImage/SDWebImageWebPCoder */ +API_AVAILABLE(ios(14.0), tvos(14.0), macos(11.0), watchos(7.0)) @interface SDImageAWebPCoder : SDImageIOAnimatedCoder @property (nonatomic, class, readonly, nonnull) SDImageAWebPCoder *sharedCoder; diff --git a/SDWebImage/Core/SDImageHEICCoder.h b/SDWebImage/Core/SDImageHEICCoder.h index 3b6036d9..f7dd6612 100644 --- a/SDWebImage/Core/SDImageHEICCoder.h +++ b/SDWebImage/Core/SDImageHEICCoder.h @@ -17,6 +17,7 @@ @note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this. @note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder */ +API_AVAILABLE(ios(13.0), tvos(13.0), macos(10.15), watchos(6.0)) @interface SDImageHEICCoder : SDImageIOAnimatedCoder @property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder;