i'm trying to animate the cell of collection view on click like this,
I have tried some code but it isn't giving perfect animation, this is my code
func collectionView(_ collectionView: UICollectionView, didHighlightItemAt indexPath: IndexPath) {
UIView.animate(withDuration: 0.8) {
if let cell = self.subCategoryCollectionView.cellForItem(at: indexPath) as? LawyerSubCategoryCVC {
cell.transform = .init(scaleX: 1.5, y: 1.5)
}
}
}
This is giving me this result,
How can i get that perfect animation on click of collection view cell?