cb428 cb428 - 1 year ago 92
Swift Question

Remove UIButton highlight for all buttons in an app

I'm wondering if there's a way to remove the highlight from UIButtons in my app. I know how to do it for an individual button (

) but I don't want to go through all the buttons in my app and do it. Is it possible to set
in the App Delegate so it applies to all buttons?

Leo Leo
Answer Source

Put this code in didFinishLaunchingWithOptions

UIButton.appearance().adjustsImageWhenHighlighted = false

Then all the default value adjustsImageWhenHighlighted of UIButton is false