You can use property observer to trigger background color change: In Swift you can override the accessor of the highlighted (or selected) property rather than.
Swift Tool Belt, Part 8: Extending UIButton with Background Color for State A UIButton can be in many states: default, selected, highlighted, or disabled. For instance, you can change the title, font, text color, shadow color, image, and iOS 7 notoriously broke away from skeuomorphism and introduced.
When favorited, I set the state to "Selected" and change the text and color. but when the button swaps back to normal, the background color change lags your code example (I'm pretty new to Swift and building iOS apps).
Im trying to create a keyboard button that shortly changes its background color when its pressed then goes back to the color it originally was but. If you are looking to get started (iOS programming in general or some specific.
You would need two events to be capture, UIControlEventTouchDown would be for when the user presses the button. UIControlEventTouchUpInside and.
In your app, if you want to make the images changes for selected and unselected state, I see lot of people are doing in this way. But there is.