Error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out."
Had this problem and had a different resolution so I thought I'd add it here:
Basically, I was sending some parameters when it should have been a clean GET request. Deleted the parameters, GET request worked just fine.
iOS Simulator -> Reset Content and Settings; worked for me
I was calling local server connection and was getting this error. I was using different network in my device and phone. When I connected both to same wifi, it worked.
There was no issue in the code. I guess the simulator internally was not able to connect to the internet, so that is why it was not able to connect to the server after providing various timeout intervals. But it worked completely fine when I executed another day. Thanks to @Andrew Jaffee for helping me to find this issue.