k" data-toggle="collapse" href="#comment-func-random">static func random()</a>
        
<div class="comment collapse" id="comment-func-random"><div class="p">
    <p>Returns a random Boolean value.</p>

<p>This method returns <code>true</code> and <code>false</code> with equal probability.</p>

<pre><code class="language-swift">let flippedHeads = Boolean.random()
if flippedHeads {
    print(&quot;Heads, you win!&quot;)
} else {
    print(&quot;Maybe another try?&quot;)
}</code></pre>

<p><code>Bool.random()