title: ignore null object in array when parse with Codable swift
body: <p>i'm parsing this API with swift Codable</p>
  
  <pre><code>"total": 7,
  "searchResult": [
      null,
      {
          "name": "joe"
          "family": "adam"
      },
      null,
      {
          "name": "martin"
          "family": "lavrix"
      },
      {
          "name": "sarah"
          "family": "mia"
      },
      null,
      {
          "name": "ali"
          "family": "abraham"
      }
  ]
  </code></pre>
  
  <p>with this <code>PaginationModel</code>:</p>
  
  <pre><code>class PaginationModel&lt;T: Codable&gt;: Codable {
      var total: Int?
      var data: T?
  
      enum CodingKeys: String, CodingKey {
          case total
          case data = "searchResult"
      }
  
      required init(from decoder: Decoder) throws {
          let container = try decoder.container(keyedBy: CodingKeys.self)
          self.total = try container.decodeIfPresent(Int.self, forKey: .total)
          self.data = try container.decodeIfPresent(T.self, forKey: .data)
      }
  }
  </code></pre>
  
  <p>and <code>User</code> Model: </p>
  
  <pre><code>struct User: Codable {
      var name: String?
      var family: String?
  }
  </code></pre>
  
  <p>i call <code>jsonDecoder</code> like this to parse API json:</p>
  
  <pre><code>let responseObject = try JSONDecoder().decode(PaginationModel&lt;[User?]&gt;.self, from: json)
  </code></pre>
  
  <p>now my problem is <code>null</code> in <code>searchResult</code> Array. it parsed correctly and when i access to <code>data</code> in <code>paginationModel</code> i found <code>null</code> in array.</p>
  
  <p>how can i ignore all <code>null</code> when parsing API, and result will be an array without any <code>null</code></p>