TableViewCell animation in swift

后端 未结 6 616
囚心锁ツ
囚心锁ツ 2021-02-04 15:54

I am following THIS tutorial and achieve that animation with this code:

func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtInd         


        
6条回答
  •  长情又很酷
    2021-02-04 16:33

    Swift 3 version works like charm!

    cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1)
        UIView.animate(withDuration: 0.3, animations: {
            cell.layer.transform = CATransform3DMakeScale(1.05, 1.05, 1)
        },completion: { finished in
            UIView.animate(withDuration: 0.1, animations: {
                cell.layer.transform = CATransform3DMakeScale(1, 1, 1)
            })
        })
    

提交回复
热议问题