Tengo varios textfields y necesito saber cuando se presiona alguno o cuando alguno tiene focus para así cambiarle el color del borde?
@IBOutlet weak var txtUsername: UITextField!
@IBOutlet weak var txtPassword: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let attributes = [
NSAttributedString.Key.foregroundColor: UIColor.placeholder,
NSAttributedString.Key.font : UIFont(name: "ITCAvantGardeStd-Bk", size: 16)! // Note the !
]
txtUsername.attributedPlaceholder = NSAttributedString(string: "Correo electrónico", attributes:attributes)
txtPassword.attributedPlaceholder = NSAttributedString(string: "Contraseña", attributes:attributes)
}
Gracias