setTextColor(_:)
Sets the text’s color.
Declaration
func setTextColor(_ color: UIColor?)Parameters
- color:
The color to be applied to the text field’s text. Specifying
nilremoves the color and returns the text to the color specified in the storyboard file. The default color is white.
Discussion
This method defines the default color of the entire string. The text field uses this color unless you explicitly override it in an attributed string using the NSForegroundColorAttributeName attribute.