WCLShineButton icon indicating copy to clipboard operation
WCLShineButton copied to clipboard

Image is never added to WCLShineButton

Open Daksh14 opened this issue 5 years ago • 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

Daksh14 avatar Jul 31 '19 17:07 Daksh14

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.

juanjovn avatar Mar 30 '20 22:03 juanjovn