 <p>To understand the ObjC style, you need to go back to C. In C, this statement:</p> <pre><code>if (something) { // Do something } </code></pre> <p>will evaluate to <code>false</code> if <code>something</code> is null or 0. Everything else evaluate to <code>true</code>. The problem is C doesn't have a boolean type. Objective-C added <code>YES</code> and <code>NO</code> which is basically 1 and 0. So:</p> <pre><code>if (aBoolValue == YES) { } // Work as expected if (anIntValue == YES) { } // False unless anIntValue == 1 </code></pre> <p>The "discouraged" recommendation was to align with the behaviour in C. Swift has no such backward compatibility requirements. You can't write these:</p> <pre><code>if anIntValue { } // Syntax error if anObject { } // Syntax error </code></pre> <p>Instead, the expression must evaluate to a boolean value:</p> <pre><code>if anIntValue != 0 { } // Ok if anObject != nil { } // Ok </code></pre>