title: Converting Boolean value to Integer value in Swift
body: <p>I was converting from Swift 2 to Swift 3. I noticed that I cannot convert a boolean value to integer value in Swift 3.</p>
  <pre><code>let p1 = (&quot;a&quot; == &quot;a&quot;) //true
  
  print(true)           //&quot;true\n&quot;
  print(p1)             //&quot;true\n&quot;
  
  Int(true)             //1
  
  Int(p1)               //error
  </code></pre>
  <p>For example these syntaxes worked fine in Swift 2. But in Swift 3, <code>print(p1)</code> yields an error.</p>
  <p>The error is <code>error: cannot invoke initializer for type 'Int' with an argument list of type '((Bool))'</code></p>
  <p>I understand why the errors are happening. Can anyone explain what is the reason for this safety and how to convert from Bool to Int in Swift 3?</p>