Hello! I am updating my app (I'm a little far behind lol) to Swift 3. I have a line of code in my app that uses dispatch_async and dispatch_get_main_queue() But, now it's been updated in Swift 3, so can you help me update this code to swift 3? Here's the snippet of the code: (line 04 is where I am having the issue)
// Create an dataTask and pass in the quest
let dataTask = session.dataTask(with: request, completionHandler: { (data, response, error) in
dispatch_async(dispatch_get_main_queue(), { () -> Void in
// Get a reference to the imageView element of the cell
let imageView = cell.viewWithTag(1) as! UIImageView
// Get an image object from the data and assign it into the imageView
imageView.image = UIImage(data: data!)
})
})
dataTask.resume()
}
return cell
Thanks for the help!