I'm writing an iOS app in Swift 3.0.1 and Xcode 8.1. I am attempting to download a file from the internet programatically.
let configuration = URLSessionConfiguration.default
let session = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
Somehow this call above is not liked by Xcode. I'm not sure what I am missing.
EDIT:
This is where I'm using this call. Inside of this I get a different error, though. "Use of instance member 'URLSession' on type 'AdvancedSettingsTableViewController'; did you mean to use a value of type 'AdvancedSettingsTableViewController' instead?"
lazy var downloadSession: URLSession = {
let configuration = URLSessionConfiguration.default
let session = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
return session
}()
EDIT 2: It almost seems like it doesn't recognize
init(configuration: URLSessionConfiguration, delegate: URLSessionDelegate?, delegateQueue queue: OperationQueue?)
as a valid initializer. If I command click on URLSession I get a question mark.