Does Swift have any built-in reverse function for a Bool?
<p>The following extension works, yet I was wondering if Swift has any out of the box function that does such reverse. I already command clicked on Bool and it doesn't have anything reverse like nor I saw anything in the Documentation.</p>

<pre><code>var x = true

extension Bool{
    mutating func reverse() -&gt; Bool{
        if self == true {
            self = false
            return self
        } else {
          self = true
          return self
        }
    }
}

print(x.reverse()) // false
</code></pre>