I am beginner in Swift and would like some help for my first application.I hope that I can explain it well. I am developing and app which is loading information from a JSON File
You have got the Json Data, Just need to put it in an array and load them into table view like this:
var tableData:NSArray = []
self.tableData = json["fruits"] as! NSArray
// In the place of json put your json object
self.tableView.reloadData()
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.tableData.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
let item = self.tableData[indexPath.row] as! [String : String]
cell.nameLabel?.text = item["Name"]
cell.descriptionLabel?.text = item["Description"]
return cell
}