3 ms·
Just tried it. In Swift: 3 == true // Give an error (operator overload doesn't cover this) true == 3 // Returns false nil == false // Returns false
by josephlord 12y ago
Just tried it.
In Swift:
3 == true // Give an error (operator overload doesn't cover this)
true == 3 // Returns false
nil == false // Returns false
You can't use nil or integers directly in an if statement without a function to return a logic value.