DynamicButton icon indicating copy to clipboard operation
DynamicButton copied to clipboard

Animation not working if button is added on Interface Builder

Open csguzman opened this issue 8 years ago • 2 comments

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 avatar Aug 22 '17 10:08 csguzman

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

csguzman avatar Aug 22 '17 12:08 csguzman

That helps:

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

ADevelopStudio avatar Jan 15 '18 04:01 ADevelopStudio