Upvote:1

Aprove answer
var notificationArr = [Notification]()

do {
  let res = try JSONDecoder().decode(JSONSource.self,from:data)
   notificationArr = res.unackd.map { $0.notification }
 }
 catch {
   print(error)
 }

Upvote:0

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueCell(yourCell.self, indexPath: indexPath)
    let notif = unackd[indexPath.row]
    (cell as? yourCell)?.title.text = notif.title
    return cell
}

Credit Goes to: stackoverflow.com

Related question with same questions but different answers