A type-safe way to write password rules in Swift.
Writing password rules in iOS 12 can really go wrong due to its string-based API.
Using this lightweight library you can now take advantage of Swift's powerful type system to avoid errors!
//Usually you do
let rules = UITextInputPasswordRules(descriptor: "allowed: unicode; required: digits; minlength: 8; maxlength: 32")
//With TypeSafePassword instead:
let safeRules = UITextInputPasswordRules(rules: [.allowed(.unicode),
.required(.digits),
.minLength(8),
.maxLength(32)])
Just drag PasswordRuleType.swift into your project and you're good to go.