This is how I create my cells :
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("FbFriendCell") as! FbFriendCell
cell.initialize()
return cell
}
Very simple.
In the initialize() function, I download an image and I put it in an UIImageView :
let theImageView = UIImageView(image: userPhoto)
theImageView.frame = CGRect(x: 0, y: 0, width: 80, height: 80)
self.addSubview(theImageView)
theImageView.image = userPhoto
println("The image has been set !")
The problem is that image only appears several seconds after this log message :
println("The image has been set !")
How can I force the image to reload ?
* READ THIS * => The issue could be strongly related to the fact that the image is inside an UITableViewCell !
Make sure you update the image on main queue
dispatch_async(dispatch_get_main_queue(), { () -> Void in
//Update UI
})
I have this issue before,and this solve my problem.Just try
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With