I\'ve seen examples of how to resolve this error but I can\'t get it to work in my case.
Initializer for conditional binding must have Optional type,
The problem is UserDefaults.standard.integer return Int, not Int?. So you don't need to wrap it with if let.
Int
Int?
if let
The optional is irrelevant whether on right side.
optional
In your case, just return UserDefaults.standard.integer(forKey: "employeeCount")
return UserDefaults.standard.integer(forKey: "employeeCount")