I am using Xcode 9 beta 5. I am trying to parse the URL. While maintaining session based on URL the code is giving syntax error.
static func fetchFeatureApp(){
let urlString="http://ebmacs.net/ubereats/Api/all_product?id=1"
URLSession.shared.dataTask(with: NSURLRequest(url: urlString)) { (data, responce, error) in
if error!=nil
{
print(error)
return
}
}.resume()
}
URLSession.shared.dataTask(with: NSURLRequest(url: urlString)) { (data, responce, error) in
This line of code is giving error
Cannot convert value of type 'String' to expected argument type 'URL' How to correct this
How can I remove this error? I have visited this link.