Animate cell when pressed using Swift 3

后端 未结 6 2143
感情败类
感情败类 2020-12-23 10:30

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

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 11:25

    You have several options.

    • You can implement the collection view delegate method collectionView(:didSelectItemAtIndexPath:) and put your code there.

    • You can attach a tap gesture recognizer to your view that you want to respond to taps.

    • You Can create a custom button and install an image into it and then use the IBAction method of the button as normal.

提交回复
热议问题