How to hide passwords in a UITextField

User text in a UITextField is visible by default, but you can enable the iOS text-hiding password functionality just by setting your text field's isSecureTextEntry property to be true, like this:

textField.isSecureTextEntry = true

Sponsored You’re already busy updating your app for Swift 4.2 and iOS 12, so why not let Instabug help you find and fix bugs? Add just two lines of code to your project and receive comprehensive reports with all the feedback you need to ship a world-class app – click here to learn more!