I have a UICollectionViewController and some cells (UICollectionViewCell). I want to draw images on some of the cells. This works fine, but when I scroll, some of the cells seems to be being unnecessarily reused, in other words cells which I didn't explicitly drawn on are being drawn on (only after scrolling).
In my cell I do the following:
imageView = UIImageView(frame: CGRectMake((self.bounds.size.width/4)-1, (self.bounds.size.height/4)-1, 30, 30));
imageView!.image = imageTick
I create an image view and set its image then add the label and image view.
Does anyone see what I am doing wrong?
Just of the case of completeness here is how I initialise the images for the cell:
let imageTick:UIImage = UIImage(named: "star")!
var imageView:UIImageView? = nil