I would like to have a timeout for 10 sec and I have used below code for that.
ℹ Please replace this with what you did.
class Manager {
static let shared = Manager()
var manager:SessionManager{
let manager = Alamofire.SessionManager.default
manager.session.configuration.timeoutIntervalForRequest = 10
return manager
}
}
ℹ Please replace this with what you expected to happen.
I was expecting a timeout to be happening after 10sec.
ℹ Please replace this with of what happened instead.
But timeout will be happening every 60 sec which is default timeout.
Alamofire version: 4.6.0
Xcode version: 9.2
Swift version: 3.2
Platform(s) running Alamofire: mac
macOS version running Xcode: 10.12.6
ℹ Please link to or upload a project we can download that reproduces the issue.
Modifying a URLSession's properties after it has been assigned to a URLSession isn't supported, per Apple's documentation. You need to create the configuration separate and initialize a separate SessionManager instance with it.
In the future, you should open questions like this on Stack Overflow and tag alamofire.
Cheers. 🍻
From our Contribution Guidelines
We don't use GitHub as a support forum. For any usage questions that are not specific to the project itself, please ask on Stack Overflow instead. By doing so, you'll be more likely to quickly solve your problem, and you'll allow anyone else with the same question to find the answer. This also allows maintainers to focus on improving the project for others.
timeout is always 60 sec after using all that work
Most helpful comment
timeout is always 60 sec after using all that work