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

Using a different image at the end of the animation #22

Open
ugur10 opened this issue May 4, 2017 · 9 comments
Open

Using a different image at the end of the animation #22

ugur10 opened this issue May 4, 2017 · 9 comments
Labels

Comments

@ugur10
Copy link

ugur10 commented May 4, 2017

Hi,

Great library, congrats 👍

With a white bordered empty icon, I want the result to become filled with color. Another option is a completely different image (i.e. white bordered as "default", filled image as "selected"). As an example, I think the heart button in Instagram fits in our case.

How can we achieve this?

Best,

Ugur

@martihag
Copy link

Hey, I added this functionality on my fork.
I'll look into preparing a PR once the maintainer returns.
https://github.com/martihag/fave-button

You can set up Cocoapods to point to a specific commit on a different fork.

@ugur10
Copy link
Author

ugur10 commented May 27, 2017

You are awesome! I just checked it out, looks super cool! Thank you! =}

@ugur10
Copy link
Author

ugur10 commented May 27, 2017

Martin, I have a question.

I used a star line icon with a yellow filled star.

Star ended up being completely red like the heart icon. Why is this?

@martihag
Copy link

For your assets, make sure they render as template.
In Interface Builder, make sure to set the same color for selected and normal. And of course also set a selected image (just added).

If you have done all this I am not sure what´s wrong.

@ugur10
Copy link
Author

ugur10 commented May 27, 2017

screen shot 2017-05-27 at 15 59 53

screen shot 2017-05-27 at 16 00 17

First one, the heart image. Just like your in the demo.

The second, is the star. I had to pick yellow to make it like this.

I am very very thankful. But for an image with colors more than one, I think there might be a problem. For the Selected Color attribute, I believe the default is red, so for the heart there is no problem. But for a final image, if the color is only one and different than that red color, you have to pick on the storyboard.

For the image with many colors etc., like I said, we may need to add something more.

Thank you so much!

@martihag
Copy link

Oh yeah, the default red color can be confusing, and both colors needs to be set explicitly.
It looks correct on your second one. You got it solved for now then?

@AlbertoLourenco
Copy link

Thanks @martihag ! 👍

@stakada7
Copy link

🎉

@moetanahy
Copy link

Hi @janselv - thanks for the library - it looks great. I'd love to have this feature implemented within the Fave button library. Is there any chance this will be integrated soon?

@martihag thanks for sharing your fork - I'd love to use it, but it's not compatible with Swift 5 I believe (some issues with renaming NSLayoutConstraints I believe).

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

No branches or pull requests

6 participants