designerwhe.blogg.se

Set button text custom color swift
Set button text custom color swift












set button text custom color swift

I think the trend is somewhere in the middle of using buttons with just text and a skeuomorphic design. They conveyed their different states and purposes with just text color. IOS 7 notoriously broke away from skeuomorphism and introduced buttons that had no background color. For some reason, Apple decided not to include it. For instance, you can change the title, font, text color, shadow color, image, and background image, but not the background color. There are also many items on a UIButton that you can customize for the different states. This extension adds a bit of functionality that is sorely missing from UIButton, giving you the ability to set the background color for different button states.Ī UIButton can be in many states: default, selected, highlighted, or disabled.

set button text custom color swift

The eighth item in my Swift Tool Belt is an extension for UIButton.














Set button text custom color swift