I am using xcode 9 beta 5 .I 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 I can remove this error ? I have visited this link