imwcl/WCLShineButton

Image is never added to WCLShineButton

Daksh14 opened this issue · 1 comments

I am using this code to display an image on the button

if let image = UIImage(named: "heart-smile") {
      likebutton.image = WCLShineImage.custom(image)
}

This simply does not work but it does if you change your button to a UIButton instead of a WCLShineButton. This is a bug

Hi! A little bit late but just in case someone is reading:

You have to use the case in enum defaultAndSelect(UIImage, UIImage)

In your example:

if let image = UIImage(named: "heart-smile") {
      likebutton.image = .defaultAndSelect(image, image)
}

In case you want a different image when select and deselect just change up to you the first or the second image of the enum.