mirror of
https://github.com/zhigang1992/PINRemoteImage.git
synced 2026-06-10 23:59:13 +08:00
34 lines
1.1 KiB
Objective-C
34 lines
1.1 KiB
Objective-C
//
|
|
// PINURLSessionManager.h
|
|
// Pods
|
|
//
|
|
// Created by Garrett Moon on 6/26/15.
|
|
//
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
@protocol PINURLSessionManagerDelegate <NSObject>
|
|
|
|
@required
|
|
- (void)didReceiveData:(nonnull NSData *)data forTask:(nonnull NSURLSessionTask *)task;
|
|
- (void)didCompleteTask:(nonnull NSURLSessionTask *)task withError:(nullable NSError *)error;
|
|
|
|
@optional
|
|
- (void)didReceiveAuthenticationChallenge:(nonnull NSURLAuthenticationChallenge *)challenge forTask:(nullable NSURLSessionTask *)task completionHandler:(nonnull void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
|
|
|
|
|
|
@end
|
|
|
|
@interface PINURLSessionManager : NSObject
|
|
|
|
- (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration;
|
|
|
|
- (nonnull NSURLSessionDataTask *)dataTaskWithRequest:(nonnull NSURLRequest *)request completionHandler:(nullable void (^)(NSURLResponse * _Nonnull response, NSError * _Nullable error))completionHandler;
|
|
|
|
- (void)invalidateSessionAndCancelTasks;
|
|
|
|
@property (atomic, weak, nullable) id <PINURLSessionManagerDelegate> delegate;
|
|
|
|
@end
|