Reputation:
I want to count the number of characters when User want to validate his password :
I came out so far with this code, but seems doesn't work
@IBOutlet var password: UITextField!
if (Password!.count < 6)
{
/// Not acceptable
}
Upvotes: 4
Views: 10407
Reputation: 85
for swift 5, I used this method and it is working fine
if password.text.count > 6 {
//add scenario for this case here
}
Upvotes: 1