title: How to check nil for variables in swift and avoid app crashing?
body: <p>I'm having my string declared as,</p>
  
  <pre><code>var firstName = String()
  </code></pre>
  
  <p>and I'm assigning value from parsed JSON content like,</p>
  
  <pre><code>firstName = json["first_name"].stringValue
  </code></pre>
  
  <p>But sometimes, there might be empty values in the JSON response and the app is crashing, I read about guard statement and if statement to check empty values, but that requires the declaration format to be changed, couldn't find a right way to handle this error without changing the declaration format.</p>
  
  <p>since I have declared all the variables in my app with similar formats, changing that requires time, I'm in the verge of uploading my app, this is my first swift app, if my declaration format is wrong please answer why it is, can someone help me out of this?</p>