I want to animate UITableViewCell
only in one direction [down direction]
my code:
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.alpha = 0
let transform = CATransform3DTranslate(CATransform3DIdentity, 0, 200 , 0)
cell.layer.transform = transform
UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
cell.alpha = 1
cell.layer.transform = CATransform3DIdentity
})
}
how can i stop that animation [don't perform animation] while user scroll upside?
thanks!!