So today I was experimenting with Collection Views and ran into quite an interesting bug.
The bug is that the imageView circles which I had are never perfect, unless I scroll them off the screen. Their shape resembles that of a rhombus with rounded edges.
And after I scroll up and down again so that the top cells become temporarily out of sight, the cells which were out of sight are now perfect circles.
Here is my code for the cell class:
class FavouritesCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var profilePicutreImageView: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
override var bounds: CGRect {
didSet {
contentView.frame = bounds
}
}
override func layoutSubviews() {
profilePicutreImageView.layer.borderWidth = 2.0
profilePicutreImageView.layer.masksToBounds = false
profilePicutreImageView.layer.cornerRadius = profilePicutreImageView.frame.width/2
profilePicutreImageView.layer.borderColor = UIColor.blackColor().CGColor
profilePicutreImageView.clipsToBounds = true
}
}
Any ideas about what this may be?
UPDATE---Here are the pictures of what is happening