mirror of
https://github.com/zhigang1992/PINRemoteImage.git
synced 2026-04-23 20:00:37 +08:00
* Add support for retrying and reduce default timeout. * Return HTTP error codes >= 400. Don't retry when failure is sure to occur again. * Add missing nullability * Use NSInteger
36 lines
1.2 KiB
Objective-C
36 lines
1.2 KiB
Objective-C
//
|
|
// PINURLSessionManager.h
|
|
// Pods
|
|
//
|
|
// Created by Garrett Moon on 6/26/15.
|
|
//
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
extern NSString * __nonnull const PINURLErrorDomain;
|
|
|
|
@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
|