title: How to resolve "Initializer for conditional binding must have Optional type, not 'Int'"?
body: <p>I've seen examples of how to resolve this error but I can't get it to work in my case.</p>
  
  <blockquote>
    <p>Initializer for conditional binding must have Optional type, not 'Int'</p>
  </blockquote>
  
  <p>Shouldn't <code>employeeCount</code> be optional since it is inferring the right side?</p>
  
  <pre><code>static func getEmployeeCount() -&gt; Int {
      if let employeeCount = UserDefaults.standard.integer(forKey: "employeeCount") {
          return employeeCount as! Int
      }
      return 0
  }
  </code></pre>