Beginner
Beginner

Reputation: 15

Swift error: Could not find an overload for '<' that accepts the supplied arguments

if (password.utf16 > 5) {

        var alert = UIAlertView(title: "Invalid", message: "Password must be greater then 5", delegate: self, cancelButtonTitle: "OK")
        alert.show()

    }

i used the code as above and i got the error message : Could not find an overload for '<' that accepts the supplied arguments.

may i know how to solve this problem ?

Upvotes: 0

Views: 87

Answers (1)

Randy
Randy

Reputation: 4535

Try this :

if count(password) < 5 {
...
}

Upvotes: 1

Related Questions