Enumeration
PCPasswordPolicy
public enum PCPasswordPolicy
Keys password policy.
Supports 4 types:
.optional — password is optional. If user sets password the minimal password length – 6 characters.
.short — password is required. Minimal password length – 6 characters.
.longWithLetters — password is required. Minimal password length – 8 characters. Necessarily to include both - uppercase and lowercase letters.
.longWithLettersAndDigits — password is required. Minimal password length – 8 characters. Necessarily to include at least one character from each category – uppercase letters, lowercase letters and digits.
Enumeration Cases
optional
case optional
Password is optional. If user sets password the minimal password length – 6 characters.
longWithLetters
case longWithLetters
Password is required. Minimal password length - 8 characters. Necessarily to include both
-
uppercase and lowercase letters
longWithLettersAndDigits
case longWithLettersAndDigits
Password is required. Minimal password length - 8 characters. Necessarily to include at least one character from each category – uppercase letters, lowercase letters and digits
Methods
validate(password:)
public func validate(password: String) -> Bool
Validates provided password
Parameters
Name | Type | Description |
---|---|---|
password | String |
Password to validate |
Returns
true
if password is valid