Binary operator '&=' cannot be applied to two 'Bool' operands in Swift

Viewed 4264

I'm trying to make multiple checks accumulating the result in a Bool:

My code is:

 var validParams = login.characters.count > 4;
 validParams &= password.characters.count > 6;
 validParams &= ...
 // more validations
 if (validParams) {...}

But I get the error Binary operator '&=' cannot be applied to two 'Bool' operands.

How can I do this work or rewrite this code in a non-verbose mode?

2 Answers
Related