title: How to efficiently parse a large JSON file (40mb) in SWIFT
body: <p>I am currently trying to parse a large JSON file that is over 40mb. Currently, when I load the JSON in viewdidload(), it causes a memory spike up to 300mb. Is there a library or efficient way to parse this data so that it doesnt't cause memory spikes?</p>
  
  <p>Current Code:</p>
  
  <pre><code>    if let url = URL(string: "JSON SOURCE") {
          URLSession.shared.dataTask(with: url, completionHandler: { (data, response, error) in
              if let err = error {
                  print("Failed to fetch schools", err)
                  return
              }
              guard let data = data else {return}
              do {
              let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers)
                  guard let dictionaries = json as? [[String: Any]] else {return}
  
                dictionaries.forEach({ (item) in
                      self.array.append(item["value"] as? String)
                  })
                  print(dictionaries)
              } catch let jsonError {
                  print("Failed to parse JSON properly ", jsonError)
              }
          }).resume()
      }
  </code></pre>