Is it possible to add timeout handler for Alamofire request?
In my project I use Alamofire this way:
init() { let configuration = NSURLSessionCon
Swift 3.x
Accepted answer didn't worked for me too.
This work for me!
let url = URL(string: "yourStringUrl")! var urlRequest = URLRequest(url: url) urlRequest.timeoutInterval = 5 // or what you want
And after:
Alamofire.request(urlRequest).response(completionHandler: { (response) in /// code here }