how to connect weather api to swift code example
Example 1: weather api in ios swift 5
private let dataManager = DataManager(baseURL: API.AuthenticatedBaseURL)
Example 2: 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)
}
}