override var isHighlighted: Bool{
didSet{
if isHighlighted{
//self.alpha = 0.5
UIView.animate(withDuration: 0.27, delay: 0.0, usingSpringWithDamping: 1, initialSpringVelocity: 1.0, options: [.curveEaseOut, .beginFromCurrentState], animations: {
self.transform = self.transform.scaledBy(x: 0.92, y: 0.92)
}, completion: nil)
} else {
//self.alpha = 1
UIView.animate(withDuration: 0.27, delay: 0.0, usingSpringWithDamping: 1, initialSpringVelocity: 1.0, options: [.curveEaseOut, .beginFromCurrentState], animations: {
self.transform = CGAffineTransform.identity
}, completion: nil)
}
}
}
animation like this dont work with pod :((
class ColorCell : UICollectionViewCell {
}