I currently have a UITextfield with an eye icon in it that when pressed is supposed to toggle the secure text entry on and off.
UITextfield
I know you can che
Why to use an extra var. In the action method of the eye button just do as below
var
password.secureTextEntry = !password.secureTextEntry
UPDATE
Swift 4.2 (as per @ROC comment)
password.isSecureTextEntry.toggle()