Now I have a custom cell with the image and label. Later I print these cells by:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:customCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! customCell
var url = NSURL(string: postCover[indexPath.row])
if let data = NSData(contentsOfURL: url!) {
cell.cellImage.image = UIImage(data: data)
}
var title = postTitle[indexPath.row]
cell.cellLabel.text = title
let indexPath = tableView.indexPathForSelectedRow()
return cell
}
and when I open an app and scroll it freezes. How can I fix this bug?
I read about it, that I must use async image loading in my tableView, but don't I load them async already?
I searched and think about it 4-5 days and nothing. Can anyone give me some tips, please?