So I have a ContainerView that is contains a UITableviewController. In the UITableviewController I am using this code:
let cell = tableView.dequeueReusableCellWithIdentifier("UserSearchCell", forIndexPath: indexPath) as! UserSearchCell
let user = tableUsers[indexPath.row]
cell.userLabel.text = user.cell!
if (!UIAccessibilityIsReduceTransparencyEnabled()) {
cell.backgroundColor = UIColor.clearColor()
let blurEffect = UIBlurEffect(style: .Light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
cell.backgroundView = blurEffectView
cell.selectedBackgroundView = blurEffectView
}
dispatch_async(dispatch_get_main_queue(),{
let downloadableUrl = "https://" + Helpers().getCDN()! + "/users/" + user.user_id! + "/photo/thumbs/" + user.photo! as String
print(downloadableUrl)
cell.userPhoto.kf_setImageWithURL(NSURL(string: downloadableUrl), placeholderImage: UIImage(named: "noavatar"))
})
return cell
Now the first Cell Image loads, however, the rest of Cells all have the SAME image. I have tried running dispatch_async(dispatch_get_main_queue(),{ }) in multiple places for fear of it being a thread issue but still have had no luck. Any Ideas what might be causing this?
There should be no need to run with dispatch_async. However, I have no idea about what causes it. The code seems good to me and it should work if you have correct model.
So I have a ContainerView that is contains a UITableviewController. In the UITableviewController I am using this code:
Now the first Cell Image loads, however, the rest of Cells all have the SAME image. I have tried running dispatch_async(dispatch_get_main_queue(),{ }) in multiple places for fear of it being a thread issue but still have had no luck. Any Ideas what might be causing this?
Thanks in advance!