Swift 4 AlamofireImage with UITableView Cell

后端 未结 10 3247
梦如初夏
梦如初夏 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 13:53

    First you have to check , have you got the proper response if you got the reasponse than write the code like

    Alamofire.request(imageUrl!, method: .get).response { response in
    
                               if let image = UIImage(data: response.data!) {
                              cell. imageView?.image = image
                         }
          }
    

提交回复
热议问题