Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Alamofire.request(url, method: .get, parameters: nil, encoding: JSONEncoding.default)
  2. .responseJSON { response in
  3.  
  4. if let status = response.response?.statusCode {
  5. switch(status){
  6. case 200:
  7.  
  8. self.allResponse = response.result.value as! NSDictionary
  9.  
  10. if let categories = self.allResponse.value(forKey: "categories") as? [[String: AnyObject]] {
  11. for category in categories {
  12. self.categories.append(Category(dict: category))
  13. }
  14. }
  15.  
  16. self.collectionView.reloadData()
  17. default:
  18. print("error with response status: (status)")
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement