fave-button icon indicating copy to clipboard operation
fave-button copied to clipboard

Using a different image at the end of the animation

Open ugur10 opened this issue 8 years ago • 9 comments

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

ugur10 avatar May 04 '17 20:05 ugur10

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.

martihag avatar May 27 '17 10:05 martihag

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

ugur10 avatar May 27 '17 11:05 ugur10

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?

ugur10 avatar May 27 '17 12:05 ugur10

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.

martihag avatar May 27 '17 12:05 martihag

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!

ugur10 avatar May 27 '17 13:05 ugur10

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?

martihag avatar May 27 '17 15:05 martihag

Thanks @martihag ! 👍

AlbertoLourenco avatar Sep 08 '17 20:09 AlbertoLourenco

🎉

stakada7 avatar Mar 28 '18 03:03 stakada7

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

moetanahy avatar May 15 '21 04:05 moetanahy