In the response you are getting the results array. Then after you are trying to o something with the array there itself, which is wrong. After getting results array, all processing should be done in cellForRowAtIndexPath method.
Take the results array as global instead of taking tableData and imageData.
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell : UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("Cell") as! UITableViewCell
let arr:NSArray! = NSArray()
let dict = arr[indexPath.row] as! NSDictionary
cell.textLabel?.text = dict["ArticleTitle"] as? String
//Load the image here with image URL string dict["ImageURL"] as? String
return cell
}
And follow this post to load image asynchronously in tableViewCell.
Load the image to the image view inside tableview cell using following code.
if let url = NSURL(string: "http://motherofall.org/sites/default/files/blog/Ignorance.png") {
if let data = NSData(contentsOfURL: url){
cell.imageView.contentMode = UIViewContentMode.ScaleAspectFit
cell.imageView.image = UIImage(data: data)
}
}