首页 > 代码库 > 根据经纬度获取天气信息

根据经纬度获取天气信息

        let manager = AFHTTPRequestOperationManager()

        let url = "http://api.openweathermap.org/data/2.5/weather"

        let params = ["lat":latitude, "lon":longitude, "cnt": 0]

        manager.GET(url, parameters: params, success: { (operation: AFHTTPRequestOperation!, respinseObejct: AnyObject!) in

            println("JSON: " + respinseObejct.description!)

            }, failure: {(operation: AFHTTPRequestOperation!, error: NSError!) in

                println("Error" + error.localizedDescription)

                })

根据经纬度获取天气信息