weather api in ios swift 5
private func processWeatherData(data: Data, completion: WeatherDataCompletion) {
if let JSON = try? JSONSerialization.jsonObject(with: data, options: []) as AnyObject {
completion(JSON, nil)
} else {
completion(nil, .InvalidResponse)
}
}