I have my custom cell \'NewsCell\'. It contains my custom view \'ImageMosaicView\' (that is just subclass of UIView). I use it to show photos like in post in Facebook. I just pa
The right way to do this is to configure the prepareForReuse()
method inside the NewsCell
class.
override func prepareForReuse() {
super.prepareForReuse()
imageView.image = //Default image
//Whatever other things you need cleared.
}
This method is called whenever a tableView dequeues a cell. So any cached data should be cleared here or it will persist in the dequeued cell unless you manually change it before returning it in the cellForRowAt
method.