有人可以发布示例代码如何显示异步加载单元格图像的表视图? 有很多Stack Overflow问题和博客文章,其中包含早期版本Swift的工作示例代码,但我找不到任何与Swift 2.0和XCode 7兼容的示例.
有很多Stack Overflow问题和博客文章,其中包含早期版本Swift的工作示例代码,但我找不到任何与Swift 2.0和XCode 7兼容的示例.
pinterest有一个很棒的图书馆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
}
