title: How do you use the Optional variable in a ternary conditional operator?
body: <p>I want to use an Optional variable with the ternary conditional operator but it is throwing error this error: <em>optional cannot be used as boolean.</em> What am I doing wrong?</p>
  
  <pre><code>var str1: String?
  var myBool:Bool
  myBool = str1 ? true : false
  </code></pre>