title: How can I decode response data if data is nested in Swift
body: <p>I've got a problem with decoding response data. Here is my request function</p>
  
  <pre><code>  @IBAction func onGetCities(_ sender: UIButton) {
  
      guard let url = URL(string: "http://somelink.com/city-list") else { return }
  
      var request = URLRequest(url: url)
      request.httpMethod = "GET"
  
      let session = URLSession.shared
      let task = session.dataTask(with: request) { (data, response, error) in
  
  
          print(JSON(data))
          guard let data = data else { return }
          do{
              let cities = try JSONDecoder().decode([City].self, from: data)
              print(cities)
          }catch{
  
          }
      }
      task.resume()
  }
  </code></pre>
  
  <p>And City struct</p>
  
  <pre><code>struct City: Decodable {
      let id: Int
      let city: String
  }
  </code></pre>
  
  <p>Here is the response data, I want to decode "items"</p>
  
  <pre><code>{
  "offset": 0,
  "limit": 10,
  "items": [
    {id: 0, name: "City name"},
    {id: 1, name: "City name1"},
    .....
  ]
  
  }
  </code></pre>