I\'ve a UIButton
and I\'ve created an extension to add background color for different state.
I\'m using the following code:
When your UIButton
is selected. If you focus on the button, it will not highlight the button as state .Highlighted
. If it is not selected, it will highlight it as your will. For it regards you have background image in your button, it will use the default effect to highlight a image. If you want to change the state to .Selected
, you have to set the variable selected
of UIButton
to true.