PINURLSessionManager.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // PINURLSessionManager.h
  3. // Pods
  4. //
  5. // Created by Garrett Moon on 6/26/15.
  6. //
  7. //
  8. #import <Foundation/Foundation.h>
  9. extern NSString * __nonnull const PINURLErrorDomain;
  10. @protocol PINURLSessionManagerDelegate <NSObject>
  11. @required
  12. - (void)didReceiveData:(nonnull NSData *)data forTask:(nonnull NSURLSessionTask *)task;
  13. - (void)didCompleteTask:(nonnull NSURLSessionTask *)task withError:(nullable NSError *)error;
  14. @optional
  15. - (void)didReceiveAuthenticationChallenge:(nonnull NSURLAuthenticationChallenge *)challenge forTask:(nullable NSURLSessionTask *)task completionHandler:(nonnull void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
  16. @end
  17. @interface PINURLSessionManager : NSObject
  18. - (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration;
  19. - (nonnull NSURLSessionDataTask *)dataTaskWithRequest:(nonnull NSURLRequest *)request completionHandler:(nullable void (^)(NSURLResponse * _Nonnull response, NSError * _Nullable error))completionHandler;
  20. - (void)invalidateSessionAndCancelTasks;
  21. @property (atomic, weak, nullable) id <PINURLSessionManagerDelegate> delegate;
  22. @end