I have made a custom attribute inspector for my text field:
@IBInspectable var bottomColor: UIColor = UIColor.clear {
didSet {
if bottomColor == UIColor.clear {
self.borderStyle = .roundedRect
} else {
self.borderStyle = .bezel
}
self.setNeedsDisplay()
}
}
Now I want to set bottomColor
to red
when the form is submitted with an empty text field. Which would be the best way to do this?