Contents

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 nil removes 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.

See Also

Setting the Text