I'm just programming a little time for IOS using the SWIFT language.
I need to download a web file, I'm using NSURLSessionConfiguration, but this object only works for IOS 8+. And I want the app to run on devices with IOS 7+. Does anyone know how I can get around this?
func download(url: NSURL)
{
self.url = url
if #available(iOS 8.0, *) {
let sessionConfig = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(url.absoluteString)
let session = NSURLSession(configuration: sessionConfig, delegate: self, delegateQueue: nil)
let task = session.downloadTaskWithURL(url)
task.resume()
} else {
//Tratar para fazer download para versão 7
}