diff --git a/SDWebImage/SDWebImageDownloader.h b/SDWebImage/SDWebImageDownloader.h index f1bcc8e9..f4e3830f 100644 --- a/SDWebImage/SDWebImageDownloader.h +++ b/SDWebImage/SDWebImageDownloader.h @@ -85,8 +85,10 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { SDWebImageDownloaderPreloadAllFrames = 1 << 11 }; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; +FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadStartNotification; +FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadReceiveResponseNotification; +FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadStopNotification; +FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadFinishNotification; typedef SDImageLoaderProgressBlock SDWebImageDownloaderProgressBlock; typedef SDImageLoaderCompletedBlock SDWebImageDownloaderCompletedBlock; diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 155a16e5..6ae608f9 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -11,6 +11,11 @@ #import "SDWebImageDownloaderOperation.h" #import "SDWebImageError.h" +NSNotificationName const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; +NSNotificationName const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; +NSNotificationName const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; +NSNotificationName const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; + static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext; @interface SDWebImageDownloadToken () diff --git a/SDWebImage/SDWebImageDownloaderOperation.h b/SDWebImage/SDWebImageDownloaderOperation.h index 01b7ea6d..b660771f 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.h +++ b/SDWebImage/SDWebImageDownloaderOperation.h @@ -10,13 +10,6 @@ #import "SDWebImageDownloader.h" #import "SDWebImageOperation.h" -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; - - - /** Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol For the description about these methods, see `SDWebImageDownloaderOperation` diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 39aad9cd..c3dc3693 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -16,11 +16,6 @@ const float NSURLSessionTaskPriorityDefault = 0.5; const float NSURLSessionTaskPriorityLow = 0.25; #endif -NSString *const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; -NSString *const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; -NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; -NSString *const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; - static NSString *const kProgressCallbackKey = @"progress"; static NSString *const kCompletedCallbackKey = @"completed";