pod 'AlamofireImage'
import AlamofireImage
func tableView(_ tableView:UITableView, cellForRowAt indexPath:IndexPath) -> UITableViewCell {
let cell :RightSlideCell = tableView.dequeueReusableCell(withIdentifier:self.rightCellId, for: indexPath)as! RightSlideCell
let imgUrl =self.items[indexPath.row].headImage!
let url = URL(string: imgUrl)
if url !=nil{
let placeholderImage = UIImage(named: "placeholder")! //设置加载前的图片
cell.cellHeadImage.af_setImage(withURL:url,placeholderImage:placeholderImage,completion:{ dataResponse in
cell.cellHeadImage.image = dataResponse.result.value
})
}
return cell
}