Good day. There is a JSON array obtained from the network. Example of one element:
{ id: 5 title: "example" house: { houseID:"100" address:"example street" } } It is houseID to properly group items by houseID Many items can have the same houseID
var arrRes = [[String:AnyObject]]() var sections = NSMutableArray() if let resData = swiftyJsonVar.arrayObject { self.arrRes = resData as! [[String:AnyObject]] } for json in self.arrRes { //нужно сгруппировать все элементы по house.addr if let data = json["house"] { let address = data["address"] as? String let houseID = data["houseID"] as? String print(address) } self.sections.addObject(json) } In the end, I want to see an array with one houseID, etc., etc., so that all this can then be passed to uiCollectionView for sections
houseID, and notid? - VAndrJhouseID? that is my goal) - Konstantin"houseID"addjsonwant? - VAndrJ