Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image is never added to WCLShineButton #22

Open
Daksh14 opened this issue Jul 31, 2019 · 1 comment
Open

Image is never added to WCLShineButton #22

Daksh14 opened this issue Jul 31, 2019 · 1 comment

Comments

@Daksh14
Copy link

Daksh14 commented Jul 31, 2019

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

@juanjovn
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants