I read a tweet from Luke Wroblewski this morning, which lead to a blog post he published on November 7, 2012 called Mobile Design Details: Hide/Show Passwords.
The fact that I have to manually enter passwords on mobile has been a constant source of frustration for me, with this only making it worse. Sadly his advice has not caught on much with app/site designers and developers. I decided to see how hard it was to quickly implement on iOS with a few thoughts along the way.
It turns out it’s very simple.
Using Xcode 5.0.2, do File - New - Project - Application: Single View Application.
Add a Text Field to the single View Controller in Main.storyboard. You can add Placeholder text to give the user a visual indication of what they should be doing with the field.
Create an Outlet Connection in ViewController.h called password, which should look like this.
In ViewController.m, put the following code into viewDidLoad.
And then create hideShow.
You should get something like this.
You can immediately touch and start entering your un-obfuscated password.
If you touch ‘HIDE’ then your password is obfuscated, and similarly touching ‘SHOW’ will go back to your un-obfuscated password.
It’s important to remember that we’re simply toggling the iOS UITextField ‘Secure’ functionality, so when the UITextField is not secure, the user can copy the contents of the UITextField.
Therefore you should only use this pattern in Sign Up and Login views, not views where you can view/edit account details for a service.
This still doesn’t remove the frustration of having to manually enter passwords on mobile. It would be great to see Apple take the lead with iOS, and extend the iCloud Keychain / Safari Password AutoFill (and generator) features to native apps.