Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Alamofire.request(url, method: .get, parameters: nil, encoding: JSONEncoding.default)
- .responseJSON { response in
- if let status = response.response?.statusCode {
- switch(status){
- case 200:
- self.allResponse = response.result.value as! NSDictionary
- if let categories = self.allResponse.value(forKey: "categories") as? [[String: AnyObject]] {
- for category in categories {
- self.categories.append(Category(dict: category))
- }
- }
- self.collectionView.reloadData()
- default:
- print("error with response status: (status)")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement