Bläddra i källkod

Migrating to `_Nullable`

Kevin Harwood 10 år sedan
förälder
incheckning
f4179e28a4

+ 6 - 6
AFNetworking/AFURLRequestSerialization.h

@@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
                                withParameters:(nullable id)parameters
-                                        error:(NSError * __nullable __autoreleasing *)error;
+                                        error:(NSError * _Nullable __autoreleasing *)error;
 
 @end
 
@@ -225,7 +225,7 @@ forHTTPHeaderField:(NSString *)field;
 - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
                                  URLString:(NSString *)URLString
                                 parameters:(nullable id)parameters
-                                     error:(NSError * __nullable __autoreleasing *)error;
+                                     error:(NSError * _Nullable __autoreleasing *)error;
 
 /**
  @deprecated This method has been deprecated. Use -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error: instead.
@@ -252,7 +252,7 @@ forHTTPHeaderField:(NSString *)field;
                                               URLString:(NSString *)URLString
                                              parameters:(nullable NSDictionary *)parameters
                               constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
-                                                  error:(NSError * __nullable __autoreleasing *)error;
+                                                  error:(NSError * _Nullable __autoreleasing *)error;
 
 /**
  Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished.
@@ -267,7 +267,7 @@ forHTTPHeaderField:(NSString *)field;
  */
 - (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request
                              writingStreamContentsToFile:(NSURL *)fileURL
-                                       completionHandler:(nullable void (^)(NSError * __nullable error))handler;
+                                       completionHandler:(nullable void (^)(NSError * _Nullable error))handler;
 
 @end
 
@@ -291,7 +291,7 @@ forHTTPHeaderField:(NSString *)field;
  */
 - (BOOL)appendPartWithFileURL:(NSURL *)fileURL
                          name:(NSString *)name
-                        error:(NSError * __nullable __autoreleasing *)error;
+                        error:(NSError * _Nullable __autoreleasing *)error;
 
 /**
  Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary.
@@ -308,7 +308,7 @@ forHTTPHeaderField:(NSString *)field;
                          name:(NSString *)name
                      fileName:(NSString *)fileName
                      mimeType:(NSString *)mimeType
-                        error:(NSError * __nullable __autoreleasing *)error;
+                        error:(NSError * _Nullable __autoreleasing *)error;
 
 /**
  Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary.

+ 2 - 2
AFNetworking/AFURLResponseSerialization.h

@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response
                            data:(nullable NSData *)data
-                          error:(NSError * __nullable __autoreleasing *)error;
+                          error:(NSError * _Nullable __autoreleasing *)error;
 
 @end
 
@@ -96,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response
                     data:(nullable NSData *)data
-                   error:(NSError * __nullable __autoreleasing *)error;
+                   error:(NSError * _Nullable __autoreleasing *)error;
 
 @end
 

+ 14 - 14
AFNetworking/AFURLSessionManager.h

@@ -223,7 +223,7 @@ NS_ASSUME_NONNULL_BEGIN
  @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
  */
 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
-                            completionHandler:(nullable void (^)(NSURLResponse *response, id __nullable responseObject,  NSError * __nullable error))completionHandler;
+                            completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject,  NSError * _Nullable error))completionHandler;
 
 ///---------------------------
 /// @name Running Upload Tasks
@@ -241,8 +241,8 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
                                          fromFile:(NSURL *)fileURL
-                                         progress:(NSProgress * __nullable __autoreleasing * __nullable)progress
-                                completionHandler:(nullable void (^)(NSURLResponse *response, id __nullable responseObject, NSError  * __nullable error))completionHandler;
+                                         progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+                                completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError  * _Nullable error))completionHandler;
 
 /**
  Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body.
@@ -254,8 +254,8 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
                                          fromData:(nullable NSData *)bodyData
-                                         progress:(NSProgress * __nullable __autoreleasing * __nullable)progress
-                                completionHandler:(nullable void (^)(NSURLResponse *response, id __nullable responseObject, NSError * __nullable error))completionHandler;
+                                         progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+                                completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
 
 /**
  Creates an `NSURLSessionUploadTask` with the specified streaming request.
@@ -265,8 +265,8 @@ NS_ASSUME_NONNULL_BEGIN
  @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
  */
 - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
-                                                 progress:(NSProgress * __nullable __autoreleasing * __nullable)progress
-                                        completionHandler:(nullable void (^)(NSURLResponse *response, id __nullable responseObject, NSError * __nullable error))completionHandler;
+                                                 progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+                                        completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
 
 ///-----------------------------
 /// @name Running Download Tasks
@@ -283,9 +283,9 @@ NS_ASSUME_NONNULL_BEGIN
  @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method.
  */
 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
-                                             progress:(NSProgress * __nullable __autoreleasing * __nullable)progress
+                                             progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
                                           destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
-                                    completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * __nullable filePath, NSError * __nullable error))completionHandler;
+                                    completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler;
 
 /**
  Creates an `NSURLSessionDownloadTask` with the specified resume data.
@@ -296,9 +296,9 @@ NS_ASSUME_NONNULL_BEGIN
  @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
  */
 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
-                                                progress:(NSProgress * __nullable __autoreleasing * __nullable)progress
+                                                progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
                                              destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
-                                       completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * __nullable filePath, NSError * __nullable error))completionHandler;
+                                       completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler;
 
 ///---------------------------------
 /// @name Getting Progress for Tasks
@@ -347,7 +347,7 @@ NS_ASSUME_NONNULL_BEGIN
 
  @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
  */
-- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __nullable __autoreleasing * __nullable credential))block;
+- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block;
 
 ///--------------------------------------
 /// @name Setting Task Delegate Callbacks
@@ -372,7 +372,7 @@ NS_ASSUME_NONNULL_BEGIN
 
  @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
  */
-- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __nullable __autoreleasing * __nullable credential))block;
+- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block;
 
 /**
  Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`.
@@ -386,7 +386,7 @@ NS_ASSUME_NONNULL_BEGIN
 
  @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task.
  */
-- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * __nullable error))block;
+- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block;
 
 ///-------------------------------------------
 /// @name Setting Data Task Delegate Callbacks

+ 6 - 6
UIKit+AFNetworking/UIButton+AFNetworking.h

@@ -44,8 +44,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 /**
  Set the shared image downloader used to download images.
+
  @param imageDownloader The shared image downloader used to download images.
- */
+*/
 + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
 
 /**
@@ -53,7 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
  */
 + (AFImageDownloader *)sharedImageDownloader;
 
-
 ///--------------------
 /// @name Setting Image
 ///--------------------
@@ -92,8 +92,8 @@ NS_ASSUME_NONNULL_BEGIN
  @param state The control state.
  @param urlRequest The URL request used for the image request.
  @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
- @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`.
- @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
  */
 - (void)setImageForState:(UIControlState)state
           withURLRequest:(NSURLRequest *)urlRequest
@@ -140,8 +140,8 @@ NS_ASSUME_NONNULL_BEGIN
  @param state The control state.
  @param urlRequest The URL request used for the image request.
  @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
- @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`.
- @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
  */
 - (void)setBackgroundImageForState:(UIControlState)state
                     withURLRequest:(NSURLRequest *)urlRequest

+ 0 - 189
UIKit+AFNetworking/UIButton+AFNetworking.h.orig

@@ -1,189 +0,0 @@
-// UIButton+AFNetworking.h
-// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_IOS || TARGET_OS_TV
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class AFImageDownloader;
-
-/**
- This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
-
- @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
- */
-@interface UIButton (AFNetworking)
-
-///------------------------------------
-/// @name Accessing the Image Downloader
-///------------------------------------
-
-/**
- Set the shared image downloader used to download images.
-<<<<<<< b4f8a67ba4dabf3e3365512f70fc0a83644ed21c
- @param imageDownloader The shared image downloader used to download images.
- */
-=======
-
- @param imageDownloader The shared image downloader used to download images.
-*/
->>>>>>> Added documentation
-+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
-
-/**
- The shared image downloader used to download images.
- */
-+ (AFImageDownloader *)sharedImageDownloader;
-<<<<<<< b4f8a67ba4dabf3e3365512f70fc0a83644ed21c
-
-=======
->>>>>>> Added documentation
-
-///--------------------
-/// @name Setting Image
-///--------------------
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
-
-  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- @param state The control state.
- @param url The URL used for the image request.
- */
-- (void)setImageForState:(UIControlState)state
-                 withURL:(NSURL *)url;
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- @param state The control state.
- @param url The URL used for the image request.
- @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
- */
-- (void)setImageForState:(UIControlState)state
-                 withURL:(NSURL *)url
-        placeholderImage:(nullable UIImage *)placeholderImage;
-
-/**
- Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
-
- @param state The control state.
- @param urlRequest The URL request used for the image request.
- @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
-<<<<<<< b4f8a67ba4dabf3e3365512f70fc0a83644ed21c
- @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`.
- @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
-=======
- @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the request and response parameters will be `nil`.
- @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
->>>>>>> Added documentation
- */
-- (void)setImageForState:(UIControlState)state
-          withURLRequest:(NSURLRequest *)urlRequest
-        placeholderImage:(nullable UIImage *)placeholderImage
-                 success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
-                 failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
-
-
-///-------------------------------
-/// @name Setting Background Image
-///-------------------------------
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled.
-
- If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished.
-
- @param state The control state.
- @param url The URL used for the background image request.
- */
-- (void)setBackgroundImageForState:(UIControlState)state
-                           withURL:(NSURL *)url;
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- @param state The control state.
- @param url The URL used for the background image request.
- @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
- */
-- (void)setBackgroundImageForState:(UIControlState)state
-                           withURL:(NSURL *)url
-                  placeholderImage:(nullable UIImage *)placeholderImage;
-
-/**
- Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied.
-
- @param state The control state.
- @param urlRequest The URL request used for the image request.
- @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
- @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`.
- @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
- */
-- (void)setBackgroundImageForState:(UIControlState)state
-                    withURLRequest:(NSURLRequest *)urlRequest
-                  placeholderImage:(nullable UIImage *)placeholderImage
-                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
-                           failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
-
-
-///------------------------------
-/// @name Canceling Image Loading
-///------------------------------
-
-/**
- Cancels any executing image task for the specified control state of the receiver, if one exists.
-
- @param state The control state.
- */
-- (void)cancelImageDownloadTaskForState:(UIControlState)state;
-
-/**
- Cancels any executing background image task for the specified control state of the receiver, if one exists.
-
- @param state The control state.
- */
-- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif

+ 1 - 1
UIKit+AFNetworking/UIButton+AFNetworking.m

@@ -211,7 +211,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
 - (void)setBackgroundImageForState:(UIControlState)state
                     withURLRequest:(NSURLRequest *)urlRequest
                   placeholderImage:(nullable UIImage *)placeholderImage
-                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
                            failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
 {
     if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) {

+ 0 - 335
UIKit+AFNetworking/UIButton+AFNetworking.m.orig

@@ -1,335 +0,0 @@
-// UIButton+AFNetworking.m
-// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "UIButton+AFNetworking.h"
-
-#import <objc/runtime.h>
-
-#if TARGET_OS_IOS || TARGET_OS_TV
-
-#import "UIImageView+AFNetworking.h"
-#import "AFImageDownloader.h"
-
-@interface UIButton (_AFNetworking)
-@end
-
-@implementation UIButton (_AFNetworking)
-
-#pragma mark -
-
-static char AFImageDownloadReceiptNormal;
-static char AFImageDownloadReceiptHighlighted;
-static char AFImageDownloadReceiptSelected;
-static char AFImageDownloadReceiptDisabled;
-
-static const char * af_imageDownloadReceiptKeyForState(UIControlState state) {
-    switch (state) {
-        case UIControlStateHighlighted:
-            return &AFImageDownloadReceiptHighlighted;
-        case UIControlStateSelected:
-            return &AFImageDownloadReceiptSelected;
-        case UIControlStateDisabled:
-            return &AFImageDownloadReceiptDisabled;
-        case UIControlStateNormal:
-        default:
-            return &AFImageDownloadReceiptNormal;
-    }
-}
-
-- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state {
-    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state));
-}
-
-- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt
-                           forState:(UIControlState)state
-{
-    objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-#pragma mark -
-
-static char AFBackgroundImageDownloadReceiptNormal;
-static char AFBackgroundImageDownloadReceiptHighlighted;
-static char AFBackgroundImageDownloadReceiptSelected;
-static char AFBackgroundImageDownloadReceiptDisabled;
-
-static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) {
-    switch (state) {
-        case UIControlStateHighlighted:
-            return &AFBackgroundImageDownloadReceiptHighlighted;
-        case UIControlStateSelected:
-            return &AFBackgroundImageDownloadReceiptSelected;
-        case UIControlStateDisabled:
-            return &AFBackgroundImageDownloadReceiptDisabled;
-        case UIControlStateNormal:
-        default:
-            return &AFBackgroundImageDownloadReceiptNormal;
-    }
-}
-
-- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state {
-    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state));
-}
-
-- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt
-                                     forState:(UIControlState)state
-{
-    objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-@end
-
-#pragma mark -
-
-@implementation UIButton (AFNetworking)
-
-<<<<<<< 1bfb8495a47f037560cc2c13302b70c4d58bb50b
-+ (id <AFImageCache>)sharedImageCache {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wgnu"
-    return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache];
-#pragma clang diagnostic pop
-}
-
-+ (void)setSharedImageCache:(__nullable id <AFImageCache>)imageCache {
-    objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-#pragma mark -
-
-- (id <AFURLResponseSerialization>)imageResponseSerializer {
-    static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
-    });
-=======
-+ (AFImageDownloader *)sharedImageDownloader {
->>>>>>> - Removed support for NSURLConnection based API's
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wgnu"
-    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
-#pragma clang diagnostic pop
-}
-
-+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
-    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-#pragma mark -
-
-- (void)setImageForState:(UIControlState)state
-                 withURL:(NSURL *)url
-{
-    [self setImageForState:state withURL:url placeholderImage:nil];
-}
-
-- (void)setImageForState:(UIControlState)state
-                 withURL:(NSURL *)url
-        placeholderImage:(UIImage *)placeholderImage
-{
-    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
-    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
-
-    [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
-}
-
-- (void)setImageForState:(UIControlState)state
-          withURLRequest:(NSURLRequest *)urlRequest
-<<<<<<< 1bfb8495a47f037560cc2c13302b70c4d58bb50b
-        placeholderImage:(UIImage *)placeholderImage
-                 success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success
-                 failure:(void (^)(NSError *error))failure
-=======
-        placeholderImage:(nullable UIImage *)placeholderImage
-                 success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
-                 failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
->>>>>>> - Removed support for NSURLConnection based API's
-{
-    if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) {
-        return;
-    }
-
-    [self cancelImageDownloadTaskForState:state];
-
-    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
-    id <AFImageRequestCache> imageCache = downloader.imageCache;
-
-    //Use the image from the image cache if it exists
-    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
-    if (cachedImage) {
-        if (success) {
-            success(urlRequest, nil, cachedImage);
-        } else {
-            [self setImage:cachedImage forState:state];
-        }
-        [self af_setImageDownloadReceipt:nil forState:state];
-    } else {
-        if (placeholderImage) {
-            [self setImage:placeholderImage forState:state];
-        }
-
-        __weak __typeof(self)weakSelf = self;
-        AFImageDownloadReceipt *receipt;
-        receipt = [downloader
-                   downloadImageForURLRequest:urlRequest
-                   success:^(NSURLSessionDataTask * _Nonnull task, UIImage * _Nonnull responseObject) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                       if ([strongSelf isActiveTaskURLEqualToURLRequest:task.originalRequest forState:state]) {
-                           if (success) {
-                               success(task.originalRequest, (NSHTTPURLResponse *)task.response, responseObject);
-                           } else if(responseObject) {
-                               [strongSelf setImage:responseObject forState:state];
-                           }
-                           [strongSelf af_setImageDownloadReceipt:nil forState:state];
-                       }
-
-                   }
-                   failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                       if ([strongSelf isActiveTaskURLEqualToURLRequest:task.originalRequest forState:state]) {
-                           if (failure) {
-                               failure(task.originalRequest, (NSHTTPURLResponse *)task.response, error);
-                           }
-                           [strongSelf  af_setImageDownloadReceipt:nil forState:state];
-                       }
-                   }];
-
-        [self af_setImageDownloadReceipt:receipt forState:state];
-    }
-}
-
-#pragma mark -
-
-- (void)setBackgroundImageForState:(UIControlState)state
-                           withURL:(NSURL *)url
-{
-    [self setBackgroundImageForState:state withURL:url placeholderImage:nil];
-}
-
-- (void)setBackgroundImageForState:(UIControlState)state
-                           withURL:(NSURL *)url
-                  placeholderImage:(nullable UIImage *)placeholderImage
-{
-    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
-    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
-
-    [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
-}
-
-- (void)setBackgroundImageForState:(UIControlState)state
-                    withURLRequest:(NSURLRequest *)urlRequest
-<<<<<<< 1bfb8495a47f037560cc2c13302b70c4d58bb50b
-                  placeholderImage:(UIImage *)placeholderImage
-                           success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success
-                           failure:(void (^)(NSError *error))failure
-=======
-                  placeholderImage:(nullable UIImage *)placeholderImage
-                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
-                           failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
->>>>>>> - Removed support for NSURLConnection based API's
-{
-    if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) {
-        return;
-    }
-
-    [self cancelImageDownloadTaskForState:state];
-
-    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
-    id <AFImageRequestCache> imageCache = downloader.imageCache;
-
-    //Use the image from the image cache if it exists
-    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
-    if (cachedImage) {
-        if (success) {
-            success(urlRequest, nil, cachedImage);
-        } else {
-            [self setImage:cachedImage forState:state];
-        }
-        [self af_setBackgroundImageDownloadReceipt:nil forState:state];
-    } else {
-        if (placeholderImage) {
-            [self setImage:placeholderImage forState:state];
-        }
-
-        __weak __typeof(self)weakSelf = self;
-        AFImageDownloadReceipt *receipt;
-        receipt = [downloader
-                   downloadImageForURLRequest:urlRequest
-                   success:^(NSURLSessionDataTask * _Nonnull task, UIImage * _Nonnull responseObject) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                       if ([strongSelf isActiveBackgroundTaskURLEqualToURLRequest:task.originalRequest forState:state]) {
-                           if (success) {
-                               success(task.originalRequest, (NSHTTPURLResponse *)task.response, responseObject);
-                           } else if(responseObject) {
-                               [strongSelf setImage:responseObject forState:state];
-                           }
-                           [strongSelf af_setImageDownloadReceipt:nil forState:state];
-                       }
-
-                   }
-                   failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                       if ([strongSelf isActiveBackgroundTaskURLEqualToURLRequest:task.originalRequest forState:state]) {
-                           if (failure) {
-                               failure(task.originalRequest, (NSHTTPURLResponse *)task.response, error);
-                           }
-                           [strongSelf  af_setBackgroundImageDownloadReceipt:nil forState:state];
-                       }
-                   }];
-
-        [self af_setBackgroundImageDownloadReceipt:receipt forState:state];
-    }
-}
-
-#pragma mark -
-
-- (void)cancelImageDownloadTaskForState:(UIControlState)state {
-    AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];
-    if (receipt != nil) {
-        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];
-        [self af_setImageDownloadReceipt:nil forState:state];
-    }
-}
-
-- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state {
-    AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];
-    if (receipt != nil) {
-        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];
-        [self af_setBackgroundImageDownloadReceipt:nil forState:state];
-    }
-}
-
-- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {
-    AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];
-    return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
-}
-
-- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {
-    AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];
-    return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
-}
-
-
-@end
-
-#endif

+ 0 - 116
UIKit+AFNetworking/UIImageView+AFNetworking.h.orig

@@ -1,116 +0,0 @@
-// UIImageView+AFNetworking.h
-// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_IOS || TARGET_OS_TV
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class AFImageDownloader;
-
-/**
- This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
- */
-@interface UIImageView (AFNetworking)
-
-///------------------------------------
-/// @name Accessing the Image Downloader
-///------------------------------------
-
-/**
- Set the shared image downloader used to download images.
-<<<<<<< b4f8a67ba4dabf3e3365512f70fc0a83644ed21c
-=======
-
->>>>>>> Added documentation
- @param imageDownloader The shared image downloader used to download images.
- */
-+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
-
-<<<<<<< b4f8a67ba4dabf3e3365512f70fc0a83644ed21c
-
-=======
->>>>>>> Added documentation
-/**
- The shared image downloader used to download images.
- */
-+ (AFImageDownloader *)sharedImageDownloader;
-
-///--------------------
-/// @name Setting Image
-///--------------------
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
-
- @param url The URL used for the image request.
- */
-- (void)setImageWithURL:(NSURL *)url;
-
-/**
- Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
-
- @param url The URL used for the image request.
- @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
- */
-- (void)setImageWithURL:(NSURL *)url
-       placeholderImage:(nullable UIImage *)placeholderImage;
-
-/**
- Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
-
- If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
-
- If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
-
- @param urlRequest The URL request used for the image request.
- @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
- @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
- @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
- */
-- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
-              placeholderImage:(nullable UIImage *)placeholderImage
-                       success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
-                       failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
-
-/**
- Cancels any executing image operation for the receiver, if one exists.
- */
-- (void)cancelImageDownloadTask;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif

+ 0 - 180
UIKit+AFNetworking/UIImageView+AFNetworking.m.orig

@@ -1,180 +0,0 @@
-// UIImageView+AFNetworking.m
-// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import "UIImageView+AFNetworking.h"
-
-#import <objc/runtime.h>
-
-#if TARGET_OS_IOS || TARGET_OS_TV
-
-#import "AFImageDownloader.h"
-
-@interface UIImageView (_AFNetworking)
-@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt;
-@end
-
-@implementation UIImageView (_AFNetworking)
-
-- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt {
-    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt));
-}
-
-- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt {
-    objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-@end
-
-#pragma mark -
-
-@implementation UIImageView (AFNetworking)
-<<<<<<< 1bfb8495a47f037560cc2c13302b70c4d58bb50b
-@dynamic imageResponseSerializer;
-
-+ (id <AFImageCache>)sharedImageCache {
-    static AFImageCache *_af_defaultImageCache = nil;
-    static dispatch_once_t oncePredicate;
-    dispatch_once(&oncePredicate, ^{
-        _af_defaultImageCache = [[AFImageCache alloc] init];
-
-        [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) {
-            [_af_defaultImageCache removeAllObjects];
-        }];
-    });
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wgnu"
-    return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache;
-#pragma clang diagnostic pop
-}
-
-+ (void)setSharedImageCache:(__nullable id <AFImageCache>)imageCache {
-    objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-#pragma mark -
-=======
->>>>>>> - Removed support for NSURLConnection based API's
-
-+ (AFImageDownloader *)sharedImageDownloader {
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wgnu"
-    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
-#pragma clang diagnostic pop
-}
-
-+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
-    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-#pragma mark -
-
-- (void)setImageWithURL:(NSURL *)url {
-    [self setImageWithURL:url placeholderImage:nil];
-}
-
-- (void)setImageWithURL:(NSURL *)url
-       placeholderImage:(UIImage *)placeholderImage
-{
-    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
-    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
-
-    [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
-}
-
-- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
-              placeholderImage:(UIImage *)placeholderImage
-<<<<<<< 1bfb8495a47f037560cc2c13302b70c4d58bb50b
-                       success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success
-                       failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, NSError *error))failure
-=======
-                       success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
-                       failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
->>>>>>> - Removed support for NSURLConnection based API's
-{
-    if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){
-        return;
-    }
-
-    [self cancelImageDownloadTask];
-
-    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
-    id <AFImageRequestCache> imageCache = downloader.imageCache;
-
-    //Use the image from the image cache if it exists
-    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
-    if (cachedImage) {
-        if (success) {
-            success(urlRequest, nil, cachedImage);
-        } else {
-            self.image = cachedImage;
-        }
-        self.af_activeImageDownloadReceipt = nil;
-    } else {
-        if (placeholderImage) {
-            self.image = placeholderImage;
-        }
-
-        __weak __typeof(self)weakSelf = self;
-        AFImageDownloadReceipt *receipt;
-        receipt = [downloader
-                   downloadImageForURLRequest:urlRequest
-                   success:^(NSURLSessionDataTask * _Nonnull task, UIImage * _Nonnull responseObject) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                       if ([strongSelf isActiveTaskURLEqualToURLRequest:task.originalRequest]) {
-                           if (success) {
-                               success(task.originalRequest, (NSHTTPURLResponse *)task.response, responseObject);
-                           } else if(responseObject) {
-                               strongSelf.image = responseObject;
-                           }
-                           strongSelf.af_activeImageDownloadReceipt = nil;
-                       }
-
-                   }
-                   failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
-                       __strong __typeof(weakSelf)strongSelf = weakSelf;
-                        if ([strongSelf isActiveTaskURLEqualToURLRequest:task.originalRequest]) {
-                            if (failure) {
-                                failure(task.originalRequest, (NSHTTPURLResponse *)task.response, error);
-                            }
-                            strongSelf.af_activeImageDownloadReceipt = nil;
-                        }
-                   }];
-
-        self.af_activeImageDownloadReceipt = receipt;
-    }
-}
-
-- (void)cancelImageDownloadTask {
-    if (self.af_activeImageDownloadReceipt != nil) {
-        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt];
-        self.af_activeImageDownloadReceipt = nil;
-     }
-}
-
-- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest {
-    return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
-}
-
-@end
-
-#endif