Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 401 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 401 Bytes

OpenWeatherMap

A swift class to feach weather information from OpenWeatherMap.org

import Foundation
import OpenWeather


let ow = OpenWeather(apiKey: "OPENWEATHERMAP_API_KEY")
if let d = ow.fetch(location: .name(city: "Sydney", state: "NSW", countryCode: "AU"))
{
  print("current temperature is \(d.main.temp)")
}
else
{
  print("fail to fetch")
}