Deserialize JSON array to Swift objects using SwiftyJSON

Viewed 5200

Given this JSON:

  {
    "id" : 1,
    "name" : "Bananas",
    "rating" : 4
  },
  {
    "id" : 2,
    "name" : "Tacos",
    "rating" : 3
  },
  {
    "id" : 3,
    "name" : "Apple",
    "rating" : 5
  }

How can you create an array of Swift objects using SwiftyJSON?

3 Answers
Related