My problem is really simple. I would like to animate a cell within a collectionView. Indeed, I would like to show a grey background behind the cell and scale down the image
If you need implement this functionality only for the specific cell, just add this code to you cell implementation:
override var isHighlighted: Bool {
didSet {
UIView.animate(withDuration: 0.5) {
let scale: CGFloat = 0.9
self.transform = self.isHighlighted ? CGAffineTransform(scaleX: scale, y: scale) : .identity
}
}
}
It is the same answer that suggested [pgdev][1] but for isHighlighted