title: Why am I allowed to set the value of an NSNumber to true/false in Swift?
body: <pre><code>var num = NSNumber(bool: false)
  num = true
  println(num) // "1"
  </code></pre>
  
  <p><code>num</code> is an <code>NSNumber</code> instance, while <code>true</code> is a <code>Boolean</code> instance. Why is this allowed, and how does it work?</p>
  
  <p>I have a feeling it implements some kind of converters, and so if that is the case, how would I implement arbitrary converters for my custom class?</p>