有人可以发布示例代码如何显示异步加载单元格图像的表视图?
有很多Stack Overflow问题和博客文章,其中包含早期版本Swift的工作示例代码,但我找不到任何与Swift 2.0和XCode 7兼容的示例.
解决方法
pinterest有一个很棒的图书馆
https://github.com/pinterest/PINRemoteImage
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 }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。