janselv / fave-button

FaveButton is an iOS cute animated like button written in Swift.
MIT License
1.51k stars 201 forks source link

Selection with no animation #14

Closed toseefkhilji closed 5 years ago

toseefkhilji commented 7 years ago

In my view there is favourite button. I want to set favbutton as selected.

So i have write this in viewDidLoad: favButton.isSelected = true

but it shows animations when my view is loading.

I only want animations on favButton tap.

So is there any method for setting selected behaviour without animation? or how can achieve this?

almatri commented 7 years ago

same issue with me , I have table with cells having faveButton. I set the favButton to selected (if the cell belongs to favorites array) in the cellForRowAtindexPath delegate

And it is very annoying to see the favButton animate while I scrolling the table.

so please allow us to disable the animation .

okipol88 commented 7 years ago

Hi All,

I added a pull request with the possibility to do just that - change the selection without animation.

https://github.com/xhamr/fave-button/pull/19

FranciscoMkdir commented 7 years ago

How?

uknowmeright commented 7 years ago

please merge this into Master branch. Thank you.

eclair4151 commented 7 years ago

for anyone who doesn't mind pulling directly off of @okipol88 branch you can do this

in your pod file pod 'FaveButton', :git => 'https://github.com/okipol88/fave-button', :branch => 'feature/selectionWithoutAnimation'

then in your code myButton.setSelected(selected: true, animated: false)

yarodevuci commented 6 years ago

@eclair4151 hey, can you update to SWIFT 4

s2mr commented 6 years ago

I have published repository merge without animation and migrating to swift4. https://github.com/kzumu/fave-button

janselv commented 5 years ago

Solved by merging @okipol88 pull request #19