【发布时间】:2016-12-16 18:38:45
【问题描述】:
我正在尝试使用 Openweathermap 使用此代码获取城市的天气:
func getWeatherByCity(city: String) {
if let weatherRequestURL = NSURL(string: "\(openWeatherMapBaseURL)?APPID=\(openWeatherMapAPIKey)&q=\(city)") {
getWeather(weatherRequestURL: weatherRequestURL)
}
}
该 api 适用于不包含空格的城市名称。
即使在主页 http://openweathermap.org/ 上,寻找 san francisco 也没有结果。
这里缺少什么?
【问题讨论】:
标签: ios swift weather-api openweathermap