title: Swift OpenWeatherMap API Value of type 'Any' error
body: <p>Hey my swift code gives an error</p>
  <blockquote>
  <p>Value of type 'Any' has no subscripts</p>
  </blockquote>
  <p>in this line</p>
  <pre><code>if let weatherArray = jsonObj.value(forKey: &quot;weather&quot;) as? NSArray {
  print(&quot;Type \(weatherArray[0][&quot;main&quot;])&quot;)
  }
  </code></pre>
  <p>I have no idea how to fix it I tried to search the web but I wasn't albo to find solution</p>
  <p>The rest of code</p>
  <pre><code>        let session = URLSession.shared
          let weatherURL = url!
          let dataTask = session.dataTask(with: weatherURL) {
          (data: Data?, response: URLResponse?, error: Error?) in
          if let error = error {
              print(&quot;Error:\n\(error)&quot;)
              }
              
          else {
              if let data = data {
                  
                  let dataString = String(data: data, encoding: String.Encoding.utf8)
                  print(&quot;All the weather data:\n\(dataString!)&quot;)
                  if let jsonObj = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) as? NSDictionary {
                      if let mainDictionary = jsonObj.value(forKey: &quot;main&quot;) as? NSDictionary {
                          if let temperature = mainDictionary.value(forKey: &quot;feels_like&quot;) {
                              DispatchQueue.main.async {
                                  print(&quot;Feels like: \(temperature)°C&quot;)
                              }
                          }
                      }
                      if let weatherArray = jsonObj.value(forKey: &quot;weather&quot;) as? NSArray {
                          print(&quot;Type \(weatherArray[0][&quot;main&quot;])&quot;)
                  
                      }
  </code></pre>