Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func llamadaWebService(){
- let urlPath = "http://api.openweatherapp.rg/data/2.5/weather?q=(String(describing: captura.text))"
- let url = URL(string: urlPath)
- let session = URLSession.shared
- let task = session.dataTask(with: url!) { (data, response, error) in
- if(error != nil) {
- //Imprime error si no está vacío . Si hay error es que hubo error en la conexión
- print("error")
- }
- let nsdata:NSData = NSData(data: data!)
- print(nsdata)
- // self.recuperarClimaDeJson(nsdata)
- }
- task.resume()
- }
Add Comment
Please, Sign In to add comment