Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. import UIKit
  2. import Alamofire
  3.  
  4. class ViewController: UIViewController {
  5.  
  6. override func viewDidLoad() {
  7. super.viewDidLoad()
  8.  
  9.  
  10. Alamofire.request("http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=44143256ee15e9c3f521ca062463dd8d").responseJSON { response in
  11. print(response.result) // result of response serialization
  12.  
  13. if let JSON = response.result.value {
  14. print("JSON: (JSON)")
  15. }
  16. }
  17. }
  18. }
  19.  
  20. JSON: {
  21. base = stations;
  22. clouds = {
  23. all = 0;
  24. };
  25. cod = 200;
  26. coord = {
  27. lat = "51.51";
  28. lon = "-0.13";
  29. };
  30. dt = 1485031800;
  31. id = 2643743;
  32. main = {
  33. humidity = 83;
  34. pressure = 1026;
  35. temp = "270.54";
  36. "temp_max" = "273.15";
  37. "temp_min" = "267.15";
  38. };
  39. name = London;
  40. sys = {
  41. country = GB;
  42. id = 5091;
  43. message = "0.0038";
  44. sunrise = 1484985141;
  45. sunset = 1485016345;
  46. type = 1;
  47. };
  48. visibility = 7000;
  49. weather = (
  50. {
  51. description = haze;
  52. icon = 50n;
  53. id = 721;
  54. main = Haze;
  55. }
  56. );
  57. wind = {
  58. speed = 1;
  59. };
  60. }
  61.  
  62. if var currentWeather = sunny {
  63. return "Nice day!"
  64. } else {
  65. return "Uh-Oh, keep warm!"
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement