sendAsynchronousRequest was deprecated in iOS 9, How to alter code to fix

后端 未结 10 2191
长发绾君心
长发绾君心 2020-12-04 15:48

Below is my code I am getting the issue with:

func parseFeedForRequest(request: NSURLRequest, callback: (feed: RSSFeed?, error: NSError?) -> Void)
{
    N         


        
10条回答
  •  时光说笑
    2020-12-04 16:22

    Swift 3.0

    var request = URLRequest(url: URL(string: "http://example.com")!)
    request.httpMethod = "POST"
    let session = URLSession.shared
    
    session.dataTask(with: request) {data, response, err in
        print("Entered the completionHandler")
    }.resume()
    

提交回复
热议问题