I have a few textfields in my view controller, I created a custom class for them:
class CustomTextField: UITextField {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.layer.cornerRadius = 15.0;
self.layer.borderWidth = 1.5
self.layer.borderColor = UIColor.white.cgColor
self.backgroundColor = UIColor.black
self.textColor = UIColor.white
}
}
In my view controller, the outlets are created like this:
@IBOutlet weak var itemCountTextField: CustomTextField! { didSet { itemCountTextField.delegate = self } }
But when I ran it, the UITextFields still look like default white text fields, the customization isn't done, where did I do wrong?