Skip to content

marcocapano/TypeSafePassword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeSafePassword

Swift Version License PRs Welcome Build Status

A type-safe way to write password rules in Swift.

The problem

Writing password rules in iOS 12 can really go wrong due to its string-based API.

Proposed solution

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)])

Installation

Just drag PasswordRuleType.swift into your project and you're good to go.

About

A type-safe way to write password rules in Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published