title: Define a variable in swift that can be Int or String
body: <p>I am trying to decode the response I am receiving from API, the response can be 0/1/&quot;skip&quot; so it can be Int or String. How do I define this variable?
  I have tried to define as: String / String? / Int / Int? , but none of these worked, all throwing an error.</p>
  <p>Code:</p>
  <pre><code>struct DatesData: Decodable {
     let state: String?
     let date: String?   &lt;-- getting the error here
  
     enum CodingKeys: String, CodingKey {
       case state
       case date = &quot;dates&quot;
     }
  }
  </code></pre>
  <p>Response is coming in like this:</p>
  <pre><code>    {
          dates = &quot;2021-03-26&quot;;
          state = 0;
      },
      {
          dates = &quot;2021-03-27&quot;;
          state = 1;
      },
      {
          dates = &quot;2021-03-28&quot;;
          state = skip;
      }
  </code></pre>
  <p>Thanks in advance</p>