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"))
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)