I am new in swift and I am trying to change cell background colour of UICollectionView but its not working my code is like this in cellForItemAt
if(cell.isSelected){
cell.backgroundColor = UIColor.green
}else{
cell.backgroundColor = UIColor.clear
}
Is there is any way to change only selected cell colour to green and other cell to clear Thanks in Advance!