NSURLSession completion block not called

前端 未结 6 839
天命终不由人
天命终不由人 2021-02-18 19:07
var session = NSURLSession.sharedSession()
session.dataTaskWithRequest(urlRequest, 
                            completionHandler: {(data: NSData!, 
                             


        
6条回答
  •  心在旅途
    2021-02-18 19:41

    It'll be something like this in Swift 2.x

    NSURLSession.sharedSession().dataTaskWithRequest(theRequest) { (data, response , error) in
        print(response)
    }.resume()
    

提交回复
热议问题