Search code examples
iosuitextfieldtextcolor

UITextField textColor updates in iOS10, not in iOS 11


My code fragment is very small:

self.textField.textColor = color

This is called in response to user interaction. It has been working for years. On my iOS 10 device it still works. On my iOS 11 device, the color does not change until I tap in the text field.

Bug? Feature? Workaround? Suggestions welcome.


Solution

  • I can trigger the text color change to take effect by adding this line below the single line cited above:

    self.textField.text = self.textField.text
    

    However, given the facts above, it still looks to me like a bug outside of my code. Or, at least, a change of the implicit class contract.