URLSessionManager

open class URLSessionManager : NSObject, URLSessionDelegate, URLSessionTaskDelegate, URLSessionDataDelegate, URLSessionDownloadDelegate, @unchecked Sendable

URLSession管理器

AFNetworking

  • 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]?

URLSessionDelegate

  • 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)

URLSessionTaskDelegate

URLSessionDataDelegate

URLSessionDownloadDelegate

NSObject

  • Undocumented

    Declaration

    Swift

    override open var description: String { get }
  • Undocumented

    Declaration

    Swift

    override open func responds(to selector: Selector!) -> Bool