I have this one line of code, which is retrieving an image from my API
. However although this works, the app is running quite slow, when I run the code to retrieve the image.
I am using the UITableView
. When I comment the code out it seems to run smoothly, is there a better way in using this code to make the app run faster? My code:
if let data = NSData(contentsOfURL: NSURL(string:events[indexPath.row].image! )!) {
cell.imageView!.image = UIImage(data: data)
}