There obviously has to be a way to AND or OR multiple booleans.
I\'m getting this error trying to write a function like this...
func isLocationWithi
While the other answer has some really interesting points, in this particular case, adding a return type to your function solves it.
func isLocationWithinView(location: CGPoint, view: UIView) -> Bool {
let a = true
let b = false
return a && b // Error: Binary operator '&&' cannot be applied to two 'Bool' operands
}
This would return true
if a
were true, and if not, it would look to b
(lazy evaluation).