소스 검색

The shared objects (not really singletons) should allow subclassing, therefore the return type should be instancetype and not a fixed type.

Bogdan Poplauschi 9 년 전
부모
커밋
c57cf7e

+ 1 - 1
SDWebImage/SDImageCache.h

@@ -63,7 +63,7 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot
  *
  * @return SDImageCache global instance
  */
-+ (nonnull SDImageCache *)sharedImageCache;
++ (nonnull instancetype)sharedImageCache;
 
 /**
  * Init a new cache store with a specific namespace

+ 1 - 1
SDWebImage/SDImageCache.m

@@ -65,7 +65,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
 
 #pragma mark - Singleton, init, dealloc
 
-+ (nonnull SDImageCache *)sharedImageCache {
++ (nonnull instancetype)sharedImageCache {
     static dispatch_once_t once;
     static id instance;
     dispatch_once(&once, ^{

+ 1 - 1
SDWebImage/SDWebImageDownloader.h

@@ -124,7 +124,7 @@ typedef SDHTTPHeadersDictionary * _Nullable (^SDWebImageDownloaderHeadersFilterB
  *
  *  @return global shared instance of downloader class
  */
-+ (nonnull SDWebImageDownloader *)sharedDownloader;
++ (nonnull instancetype)sharedDownloader;
 
 /**
  *  Set the default URL credential to be set for request operations.

+ 1 - 1
SDWebImage/SDWebImageDownloader.m

@@ -54,7 +54,7 @@
     }
 }
 
-+ (nonnull SDWebImageDownloader *)sharedDownloader {
++ (nonnull instancetype)sharedDownloader {
     static dispatch_once_t once;
     static id instance;
     dispatch_once(&once, ^{

+ 1 - 1
SDWebImage/SDWebImageManager.h

@@ -179,7 +179,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
  *
  * @return SDWebImageManager shared instance
  */
-+ (nonnull SDWebImageManager *)sharedManager;
++ (nonnull instancetype)sharedManager;
 
 /**
  * Allows to specify instance of cache and image downloader used with image manager.

+ 1 - 1
SDWebImage/SDWebImageManager.m

@@ -29,7 +29,7 @@
 
 @implementation SDWebImageManager
 
-+ (nonnull SDWebImageManager*)sharedManager {
++ (nonnull instancetype)sharedManager {
     static dispatch_once_t once;
     static id instance;
     dispatch_once(&once, ^{

+ 1 - 1
SDWebImage/SDWebImagePrefetcher.h

@@ -68,7 +68,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls,
 /**
  * Return the global image prefetcher instance.
  */
-+ (nonnull SDWebImagePrefetcher *)sharedImagePrefetcher;
++ (nonnull instancetype)sharedImagePrefetcher;
 
 /**
  * Allows you to instantiate a prefetcher with any arbitrary image manager.

+ 1 - 1
SDWebImage/SDWebImagePrefetcher.m

@@ -23,7 +23,7 @@
 
 @implementation SDWebImagePrefetcher
 
-+ (nonnull SDWebImagePrefetcher *)sharedImagePrefetcher {
++ (nonnull instancetype)sharedImagePrefetcher {
     static dispatch_once_t once;
     static id instance;
     dispatch_once(&once, ^{