From 6674b9f711ff23d8cc3715fee0859922a09b7fd3 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Tue, 3 Jul 2018 21:18:02 +0800 Subject: [PATCH 1/2] Fix HTTP Header key field nullable --- SDWebImage/SDAnimatedImageView.h | 2 +- SDWebImage/SDWebImageDownloader.m | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDAnimatedImageView.h b/SDWebImage/SDAnimatedImageView.h index db904ace..6eb071e9 100644 --- a/SDWebImage/SDAnimatedImageView.h +++ b/SDWebImage/SDAnimatedImageView.h @@ -61,7 +61,7 @@ You can specify a runloop mode to let it rendering. Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device */ -@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode NS_AVAILABLE_IOS(3_1); +@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode; @end diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 71d96bd0..cc17dd89 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -133,6 +133,9 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext; } - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { + if (!field) { + return; + } NSMutableDictionary *mutableHTTPHeaders = [self.HTTPHeaders mutableCopy]; if (value) { [mutableHTTPHeaders setObject:value forKey:field]; From c294bebec1d899f6f4607a1179c7d1ad3dae49fa Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Wed, 4 Jul 2018 14:57:20 +0800 Subject: [PATCH 2/2] update available macro --- SDWebImage/SDAnimatedImageView.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDAnimatedImageView.h b/SDWebImage/SDAnimatedImageView.h index 6eb071e9..e822c4ea 100644 --- a/SDWebImage/SDAnimatedImageView.h +++ b/SDWebImage/SDAnimatedImageView.h @@ -57,12 +57,14 @@ Default is YES. Set to NO to only render the static poster for incremental animated image. */ @property (nonatomic, assign) BOOL shouldIncrementalLoad; + +#if SD_UIKIT /** You can specify a runloop mode to let it rendering. Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device */ @property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode; - +#endif @end #endif