title: How can I Compact Code
body: <p>I have multiple text fields in my app and want all of them  to not crash if the textfield is empty. </p>
  
  <p>I have the code that fixes this but I am wondering if there is something i can write that shortcuts this code?</p>
  
  <p>SO i could write </p>
  
  <pre><code>fixNilError()
  </code></pre>
  
  <p>and it would run the code:</p>
  
  <pre><code>if textField.text != nil {
     print("Success")
  }
  </code></pre>