Previously I used AFNetworking and could easily get all the tasks for current session by tasks property. I'm trying to migrate to Alamofire 5 and I can't find the same property or way how to get all the tasks.
I create the session like this
let session: Session = {
let configuration = URLSessionConfiguration.af.default
return Session(configuration: configuration)
}()
I'd like to check does my session contain any active tasks
You don't. If you need to perform actions on all of the currently ongoing
Requests, you can useSession.withAllRequests. If all you need to do is cancel allRequests you can useSession.cancelAllRequests. Otherwise you should never access, much less interact with, theURLSessionTasks that underly an AlamofireSession.