From c8ab67e5d45cc80aa19999f8d52375736a0ef93c Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 5 Mar 2020 22:42:35 +0800 Subject: [PATCH] Override the UIImage+Metadata category method to provide the correct value for SDSVGKImage --- SDWebImageSVGKitPlugin/Classes/SDSVGKImage.m | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/SDWebImageSVGKitPlugin/Classes/SDSVGKImage.m b/SDWebImageSVGKitPlugin/Classes/SDSVGKImage.m index e1e8141..dc908a4 100644 --- a/SDWebImageSVGKitPlugin/Classes/SDSVGKImage.m +++ b/SDWebImageSVGKitPlugin/Classes/SDSVGKImage.m @@ -116,3 +116,31 @@ - (NSUInteger)animatedImageLoopCount { } @end + +@implementation SDSVGKImage (Metadata) + +- (BOOL)sd_isAnimated { + return NO; +} + +- (NSUInteger)sd_imageLoopCount { + return self.animatedImageLoopCount; +} + +- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { + return; +} + +- (SDImageFormat)sd_imageFormat { + return SDImageFormatSVG; +} + +- (void)setSd_imageFormat:(SDImageFormat)sd_imageFormat { + return; +} + +- (BOOL)sd_isVector { + return YES; +} + +@end