title: Is it possible to use a string variable in if condition in Swift?
body: <p>I'm new to iOS development and wondering if I could pass a string variable inside if statement? Here's my pseudo code:</p>
  
  <pre><code>x = 1
  func myFunc() -&gt; String {
      myString = "x == 1"
      return myString 
  }
  
  if(myfunc()) {
     code i want to execute
  }
  </code></pre>
  
  <p>I am currently getting the following error: "'String' is not convertible to 'Bool'"
  Is there a way I can do this?</p>