URLSessionManager
open class URLSessionManager : NSObject, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate, URLSessionDownloadDelegate, @unchecked Sendable
URLSession管理器
-
Undocumented
Declaration
Swift
public static let networkingTaskDidResumeNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let networkingTaskDidSuspendNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let urlSessionDidInvalidateNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let urlSessionDownloadTaskDidMoveFileSuccessfullyNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let urlSessionDownloadTaskDidFailToMoveFileNotification: Notification.Name -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteResponseDataKey: String -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteSerializedResponseKey: String -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteResponseSerializerKey: String -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteAssetPathKey: String -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteErrorKey: String -
Undocumented
Declaration
Swift
public static let networkingTaskDidCompleteSessionTaskMetrics: String -
Undocumented
Declaration
Swift
open private(set) lazy var session: URLSession { get set } -
Undocumented
Declaration
Swift
open private(set) var operationQueue: OperationQueue { get } -
Undocumented
Declaration
Swift
open var responseSerializer: HTTPResponseSerializer -
Undocumented
Declaration
Swift
open var securityPolicy: SecurityPolicy -
Undocumented
Declaration
Swift
open var tasks: [URLSessionTask] { get } -
Undocumented
Declaration
Swift
open var dataTasks: [URLSessionDataTask] { get } -
Undocumented
Declaration
Swift
open var uploadTasks: [URLSessionUploadTask] { get } -
Undocumented
Declaration
Swift
open var downloadTasks: [URLSessionDownloadTask] { get } -
Undocumented
Declaration
Swift
open var completionQueue: DispatchQueue? -
Undocumented
Declaration
Swift
open var completionGroup: DispatchGroup? -
Undocumented
Declaration
Swift
open var sessionDidBecomeInvalid: (@Sendable (_ session: URLSession, _ error: Error?) -> Void)? -
Undocumented
Declaration
Swift
open var sessionDidReceiveAuthenticationChallenge: (@Sendable (_ session: URLSession, _ challenge: URLAuthenticationChallenge, _ credential: inout URLCredential?) -> URLSession.AuthChallengeDisposition)? -
Undocumented
Declaration
Swift
open var taskNeedNewBodyStream: (@Sendable (_ session: URLSession, _ task: URLSessionTask) -> InputStream)? -
Undocumented
Declaration
Swift
open var taskWillPerformHTTPRedirection: (@Sendable (_ session: URLSession, _ task: URLSessionTask, _ response: URLResponse, _ request: URLRequest) -> URLRequest?)? -
Undocumented
Declaration
Swift
open var authenticationChallengeHandler: (@Sendable (_ session: URLSession, _ task: URLSessionTask, _ challenge: URLAuthenticationChallenge, _ completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Any?)? -
Undocumented
Declaration
Swift
open var taskDidSendBodyData: (@Sendable (_ session: URLSession, _ task: URLSessionTask, _ bytesSent: Int64, _ totalBytesSent: Int64, _ totalBytesExpectedToSend: Int64) -> Void)? -
Undocumented
Declaration
Swift
open var taskDidComplete: (@Sendable (_ session: URLSession, _ task: URLSessionTask, _ error: Error?) -> Void)? -
Undocumented
Declaration
Swift
open var taskDidFinishCollectingMetrics: (@Sendable (_ session: URLSession, _ task: URLSessionTask, _ metrics: URLSessionTaskMetrics?) -> Void)? -
Undocumented
Declaration
Swift
open var dataTaskDidReceiveResponse: (@Sendable (_ session: URLSession, _ task: URLSessionDataTask, _ response: URLResponse) -> URLSession.ResponseDisposition)? -
Undocumented
Declaration
Swift
open var dataTaskDidBecomeDownloadTask: (@Sendable (_ session: URLSession, _ dataTask: URLSessionDataTask, _ downloadTask: URLSessionDownloadTask) -> Void)? -
Undocumented
Declaration
Swift
open var dataTaskDidReceiveData: (@Sendable (_ session: URLSession, _ dataTask: URLSessionDataTask, _ data: Data) -> Void)? -
Undocumented
Declaration
Swift
open var dataTaskWillCacheResponse: (@Sendable (_ session: URLSession, _ dataTask: URLSessionDataTask, _ proposedResponse: CachedURLResponse) -> CachedURLResponse)? -
Undocumented
Declaration
Swift
open var didFinishEventsForBackgroundURLSession: (@Sendable (_ session: URLSession) -> Void)? -
Undocumented
Declaration
Swift
open var downloadTaskDidFinishDownloading: (@Sendable (_ session: URLSession, _ downloadTask: URLSessionDownloadTask, _ location: URL) -> URL?)? -
Undocumented
Declaration
Swift
open var downloadTaskDidWriteData: (@Sendable (_ session: URLSession, _ downloadTask: URLSessionDownloadTask, _ bytesWritten: Int64, _ totalBytesWritten: Int64, _ totalBytesExpectedToWrite: Int64) -> Void)? -
Undocumented
Declaration
Swift
open var downloadTaskDidResume: (@Sendable (_ session: URLSession, _ downloadTask: URLSessionDownloadTask, _ fileOffset: Int64, _ expectedTotalBytes: Int64) -> Void)? -
Undocumented
Declaration
Swift
override public convenience init() -
Undocumented
Declaration
Swift
public init(sessionConfiguration: URLSessionConfiguration?) -
Undocumented
Declaration
Swift
open func invalidateSessionCancelingTasks(_ cancelPendingTasks: Bool, resetSession: Bool) -
Undocumented
Declaration
Swift
open func dataTask( request: URLRequest, uploadProgress: (@Sendable (Progress) -> Void)? = nil, downloadProgress: (@Sendable (Progress) -> Void)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ responseObject: Any?, _ error: Error?) -> Void)? = nil ) -> URLSessionDataTask -
Undocumented
Declaration
Swift
open func uploadTask( request: URLRequest, fromFile fileURL: URL, progress: (@Sendable (Progress) -> Void)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ responseObject: Any?, _ error: Error?) -> Void)? = nil ) -> URLSessionUploadTask -
Undocumented
Declaration
Swift
open func uploadTask( request: URLRequest, fromData bodyData: Data, progress: (@Sendable (Progress) -> Void)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ responseObject: Any?, _ error: Error?) -> Void)? = nil ) -> URLSessionUploadTask -
Undocumented
Declaration
Swift
open func uploadTask( streamedRequest: URLRequest, progress: (@Sendable (Progress) -> Void)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ responseObject: Any?, _ error: Error?) -> Void)? = nil ) -> URLSessionUploadTask -
Undocumented
Declaration
Swift
open func downloadTask( request: URLRequest, progress: (@Sendable (Progress) -> Void)? = nil, destination: (@Sendable (_ targetPath: URL, _ response: URLResponse?) -> URL)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ filePath: URL?, _ error: Error?) -> Void)? = nil ) -> URLSessionDownloadTask -
Undocumented
Declaration
Swift
open func downloadTask( resumeData: Data, progress: (@Sendable (Progress) -> Void)? = nil, destination: (@Sendable (_ targetPath: URL, _ response: URLResponse?) -> URL)? = nil, completionHandler: (@Sendable (_ response: URLResponse?, _ filePath: URL?, _ error: Error?) -> Void)? = nil ) -> URLSessionDownloadTask -
Undocumented
Declaration
Swift
open func uploadProgress(for task: URLSessionTask) -> Progress? -
Undocumented
Declaration
Swift
open func downloadProgress(for task: URLSessionTask) -> Progress? -
Undocumented
Declaration
Swift
open func setUserInfo(_ userInfo: [AnyHashable : Any]?, for task: URLSessionTask) -
Undocumented
Declaration
Swift
open func userInfo(for task: URLSessionTask) -> [AnyHashable : Any]?
-
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping @Sendable (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
-
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse, newRequest request: URLRequest, completionHandler: @escaping @Sendable (URLRequest?) -> Void) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping @Sendable (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, needNewBodyStream completionHandler: @escaping @Sendable (InputStream?) -> Void) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics)
-
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping @Sendable (URLSession.ResponseDisposition) -> Void) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didBecome downloadTask: URLSessionDownloadTask) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping @Sendable (CachedURLResponse?) -> Void) -
Undocumented
Declaration
Swift
open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession)
-
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) -
Undocumented
Declaration
Swift
open func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64)
-
Declaration
Swift
override open var description: String { get } -
Undocumented
Declaration
Swift
override open func responds(to selector: Selector!) -> Bool
View on GitHub