The custom UITableViewCell
includes an image which is loaded asynchronously from web, and its size/aspectRatio is not known beforehand, so there is no way to return the accurate cell height in tableView:heightForRowAtIndexPath:
.
I can return an estimated height in the delegate method, but need to inform the tableView of the cell height change when the image is loaded. How should I do that?
reloadData
would be too heavy-weight, considering each time an image is loaded, the whole tableView is refreshed.reloadRowsAtIndexPaths:withRowAnimation:
is not good, either. As the cell itself doesn't change, just its height needs to be updated.