W.Snail W.Snail - 10 days ago 5
iOS Question

I write some code use swift and Xcode 8,but have some error

seesion.dataTask(with:request) { (data,res,err) in
print("Hello")
}


Ambiguous reference to member 'dataTask(with:completionHandler:)

Answer

You use this code

 session.dataTask(with:request as URLRequest) { (data,res,err) in
            print("Hello")
        }
Comments