title: How to toggle a UITextField secure text entry (hide password) in Swift?
body: <p>I currently have a <code>UITextfield</code> with an eye icon in it that when pressed is supposed to toggle the secure text entry on and off. </p>
  
  <p><a href="https://i.stack.imgur.com/HU15S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HU15S.png" alt="secure text entry"></a></p>
  
  <p>I know you can check mark the "secure text entry" box in the attributes inspector but how to do it so it toggles whenever the icon is pressed?</p>