Swift 4 AlamofireImage with UITableView Cell

后端 未结 10 3296
梦如初夏
梦如初夏 2021-02-20 12:56

I am using AlamofireImages to try to download an image from a server and display it in my table view cell, this is what I got, but my images does not appear, just the textLabel

10条回答
  •  忘了有多久
    2021-02-20 14:03

    You can use SDWebImage

    First You need to Import this

    import SDWebImage
    

    Then You may use this method

    let imgUrl = URL(string:"your image URL string")
    cell.imageView?.sd_setImage(with: imgUrl, placeholderImage: UIImage(named: "propic"))
    

提交回复
热议问题