I am experiencing issues where the text I have input into a UITextField is disappearing whenever it is resigned as the first responder. When you tap back into the text field, the text re-appears. The UITextField subclass has nothing in it apart from a slight rounding to the corners. I will be adding more at a later date. Has anyone experienced issues like this before?
Here is my code. Like I said there is nothing in this subclass apart from the rounding of the corners. I will be putting code to add padding to the textfield later.
Code
import UIKit
class EVTextField: UITextField
{
override func layoutSubviews()
{
layer.cornerRadius = 2.0
}
}
Step by step guide to replicate
- Tap on UITextField.
- Enter text.
- Either dismiss keyboard or tap into next UITextField.
- Text seems to disappear in previously resigned UItextField.
