Guest User

swift - json

a guest
Oct 31st, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. JSON -
  2. [[{"Title":"testi27","Original filename":"rainforest.mp3","Description":"joo","Tags":"testi\r\n\u00e4\u00e4ni\r\njoo","Category":"","Sound Type":"soundscapes","Creation date":"2016-10-27 12:20:42","File extension":"mp3","File size(KB)":"154.8","Created by":"podcast","Collection name":"ylepodcast","Collection ID":"5","Download link":"http:lii.fi"}],[{"Title":"Adrenaline","Original filename":"Adrenaline.mp3","Description":"there goes descriptions","Tags":"Category:Music\r\nMusic","Category":"","Sound Type":"soundscapes","Location - longitude":"www.imgur.com","Length (sec)":"132","Creation date":"2016-10-27 13:29:28","File extension":"mp3","File size(KB)":"5301.0","Created by":"podcast","Collection name":"Testi","Collection ID":"17","Download link":"http:lii.fi"}]]
  3.  
  4. Swift -
  5. Alamofire.request("link_to_json/", method: .get, parameters:parameters)
  6. .responseJSON{response in
  7. if let json = response.result.value {
  8. if let array = json as? [Any] {
  9.  
  10. for (index, item) in array.enumerated() {
  11. print(index)
  12. }
  13. }
  14.  
  15. }
  16. }else{
  17. print("error")
  18. }
Advertisement
Add Comment
Please, Sign In to add comment