I have a text field, I have already included an image on the right side, clicking on this would like to reveal the password, however, I am not able to reach this result. The current code is:
import UIKit
class LoginViewController: UIViewController {
@IBOutlet weak var usuarioOuEmail: UITextField!
@IBOutlet weak var senha: UITextField!
@IBOutlet weak var mostrar: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
let imageView = UIImageView();
imageView.image = UIImage(named: "logo.png")
imageView.frame = CGRectMake(0, 0, 23, 23);
senha.rightView = imageView
senha.rightViewMode = UITextFieldViewMode.Always
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
How do I click another image to trigger the image?