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

Animation not working if button is added on Interface Builder #18

Open
csguzman opened this issue Aug 22, 2017 · 2 comments
Open

Animation not working if button is added on Interface Builder #18

csguzman opened this issue Aug 22, 2017 · 2 comments

Comments

@csguzman
Copy link

I added a button on interface builder. Set up click event. When changing the style, the animation is not working. The style does change, but without animation

@csguzman
Copy link
Author

the problem was not adding the button from interface builder, but changing the style from the click event. Somehow, it doesn't work

@csguzman csguzman reopened this Aug 22, 2017
@ADevelopStudio
Copy link

ADevelopStudio commented Jan 15, 2018

That helps:

   @IBAction func buttonPressed(_ sender: Any) {
            DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100), execute: {
               self.dynamicBtn.setStyle(.caretUp, animated: true)
            })
    }

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