-1

I am using SDWebImage to set the cells button image:

cell.categoryButton.sd_setImage(with: URL(string:cell.image), for: .normal, placeholderImage: UIImage(named: "image"))

but what I get is a blue image like that: I don't know why enter image description here

Community
  • 1
  • 1
Mor Goren
  • 105
  • 9

1 Answers1

1

You need to use the sd_setBackgroundImage property since you are setting the background image of a button (UIButton), not setting an image to UIImageView.

cell.categoryButton.sd_setBackgroundImage(with: URL(string:cell.image), for: .normal, completed: nil)
El Tomato
  • 6,479
  • 6
  • 46
  • 75