Strong Password suggestion in iOS 12+

This article explains how to enable strong password suggestion in IOS.

Image from WWDC video

How to enable strong password autofill in iOS?

Enabling this feature is easy. All you need to do is set the textContentType property to .newPassword:

newPasswordTextField.contentType = .newPassword

How to customize Password AutoFill Rules?

Say you want to require a password with at least eight characters consisting of a mix of uppercase and lowercase letters, at least one number, and at most two consecutive characters. You would add this markup:

let newPasswordTextField = UITextField()
newPasswordTextField.passwordRules = UITextInputPasswordRules(descriptor: "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;")
Password validation tool

If you enjoyed reading this post, please share and give some clapps so others can find it 👏👏👏👏👏 !!!!

You can follow me on Medium for fresh articles. Also, connect with me on LinkedIn.



iOS and tvOS developer, dreamer, photographer 🤨

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store