This is a normal state of my UIButton:
But when I press on the UIButton, its highlight color should be changed to a different one. And here is what I have:
So, if you can notice, my white text becomes overlapped with the new color. But what I should have as a result is just a different color of the highlight and always the white text. Like so:
What I am doing so far is:
- In Attribute Inspector in my xib file I changed the
Highlight Color
to a new one. - I also use
updateButton.setTitleColor(.white, for: .highlighted)
in my code but it doesn't help.
I've also taken a look at this question: UIButton background color overlaps text on highlight but the accepted answer didn't help much.