pinterest has an excellent library for this
https://github.com/pinterest/PINRemoteImage
import PINRemoteImage
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let j = MYCELLOBJECT![indexPath.row]
let c = tableView.dequeueReusableCellWithIdentifier(CUSTOMCell.id) as! CUSTOMCell
c.Icon?.pin_setImageFromURL(NSURL(string: j.URLTOIMAGE), placeholderImage: UIImage(), processorKey: "Ball", processor: { (result, cost) -> UIImage! in
return result.image
}, completion: { (result) -> Void in })
return c
}
source
share