I am trying to compare colors but I cannot use the isEqual
method because I am trying to compare the color of the background of a UICollectionViewCell
.
What is the correct way to compare colors in this situation?
if(cell!.layer.backgroundColor! == UIColor.redColor().CGColor)
{
cell?.layer.backgroundColor = UIColor.redColor().CGColor
}