Skip to content

Instantly share code, notes, and snippets.

@aGupieWare
Created November 11, 2014 00:00
Show Gist options
  • Select an option

  • Save aGupieWare/99335bd505bc8c8d6863 to your computer and use it in GitHub Desktop.

Select an option

Save aGupieWare/99335bd505bc8c8d6863 to your computer and use it in GitHub Desktop.
Swift client refined JSON response . . .
var rawInventoryItems = jsonResult["data"] as Array<Dictionary<String,String>>
var refinedInventoryItems : Array<PlumbingSupplyItem> = []
for itemDict in rawInventoryItems {
var item : PlumbingSupplyItem = PlumbingSupplyItem(bsn_id: itemDict["id"], bsn_name: itemDict["name"], bsn_image: itemDict["image"], bsn_description: itemDict["description"])
refinedInventoryItems.append(item)
}
return refinedInventoryItems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment