Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.47 KB | None | 0 0
  1. Alamofire.request("https://jsonplaceholder.typicode.com/todos/1").responseJSON { response in
  2.     if let response = response.result.value {
  3.         let json = JSON(response)
  4.  
  5.         let userId = json["userId"].intValue
  6.         let id = json["userId"].intValue
  7.         let title = json["title"].stringValue
  8.         let completed = json["completed"].boolValue
  9.  
  10.         let nextHour = NextHour(userId: userId, id: id, title: title, completed: completed)
  11.  
  12.         data = [nextHour]
  13.  
  14.         collectionView.reloadData()
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement