UITextField textColor updates in iOS10, not iOS 11

My code snippet is very small:

self.textField.textColor = color

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

Bug? Feature? Workaround Suggestions are welcome.

+4
source share
2 answers

I can initiate a text color change to take effect by adding this line below the one line above:

self.textField.text = self.textField.text

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

+2
source

/ reset UITextField :

self.textField.textColor = color
self.textField.text = "Hi! I've changed of color!!"

, :

 self.textField.textColor = color
 self.textField.text =  self.textField.text
+5

Source: https://habr.com/ru/post/1687502/


All Articles