 <pre><code>//Your example json results = [{"type":"fruit", "name":"orange"},{"type":"flower","name":"rose"},{"type":"fruit", "name":"apple"}] </code></pre> <p>First you need to turn your json into an array of dictionaries to get the above object you think it will be:</p> <pre><code>if let results = try NSJSONSerialization.JSONObjectWithData(data,options: NSJSONReadingOptions.MutableContainers) as? [[String : AnyObject]] { //parse into form you want.} // Your example desired result of dictionary with key:array of dictionaries updatedResult[String:[AnyObject]]() = {"fruit":[{"name":"orange"},{"name":"apple"}],"flower":[{"name":"rose"}]} </code></pre> <p>Then you want to loop through the json result and grab out the values into the above format you want:</p> <pre><code>// Swift representation of your provided example let results = [["type":"fruit", "name":"orange"],["type":"flower","name":"rose"],["type":"fruit", "name":"apple"]] // Desired dictionary of key:array of dictionaries var updatedResult = [String:[[String:String]]]() for item in results { if let name = item["name"], type = item["type"] { if updatedResult.keys.contains(type) { updatedResult[type]!.append(["name":name]) } else { updatedResult[type] = [["name":name]] } } } </code></pre>