title: Check if the integer value of a text field is valid in a switch statement [swift]
body: <p>I've been attempting to check if the integer value of a text field is valid in a switch statement to cover more possible cases rather having long if/elseif statements.</p>
  
  <pre><code>switch characterTextFields {
  case Int(characterTextFields[1].text!) == nil:
      validationErrorModal(text: "Level must be a number!")
  }
  </code></pre>
  
  <p>The code above prompts the following error: </p>
  
  <blockquote>
    <p>Expression pattern of type 'Bool' cannot match values of type '[UITextField]?'</p>
  </blockquote>
  
  <p>characterTextFields is an array of text fields. I did research about possibly solutions which involved using let and where keywords, but wasn't able to implement correctly. Any suggestions?</p>