I am using iOS 7\'s new NSURLSessionDataTask to retrieve data as follows:
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDat
For Swift 4:
let config = URLSessionConfiguration.default
config.timeoutIntervalForRequest = TimeInterval(15)
config.timeoutIntervalForResource = TimeInterval(15)
let urlSession = URLSession(configuration: config)
The timeoutIntervalForRequest is for all tasks within sessions based on this configuration. The timeoutIntervalForResource is for all tasks within sessions based on this configuration.