Ios Swift 3在wilDisplay单元格动画期间与tableView交互

Ios Swift 3在wilDisplay单元格动画期间与tableView交互,ios,uitableview,swift3,xcode8,Ios,Uitableview,Swift3,Xcode8,我想让你可以在动画结束前与tableView交互,当我尝试实现willDisplay单元格功能时,我得到了一个成功的动画,但你不能在动画结束前与单元格交互 这是我的手机代码: func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { cell.alpha = 0.5 UIView.animate(wit

我想让你可以在动画结束前与tableView交互,当我尝试实现willDisplay单元格功能时,我得到了一个成功的动画,但你不能在动画结束前与单元格交互

这是我的手机代码:

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {

        cell.alpha = 0.5

        UIView.animate(withDuration: 1.0) {

            cell.alpha = 1.0

        }

    }
当我尝试在此处使用DiEndDisplaying cell函数完成动画时,它完全没有动画效果:

func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {

        cell.alpha = 0.5

        UIView.animate(withDuration: 1.0) {

            cell.alpha = 1.0

        }

    }
我甚至尝试将这两种方法结合使用,但仍然没有成功:

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {

        cell.alpha = 0.5

    }

    func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {

        UIView.animate(withDuration: 1.0) {

            cell.alpha = 1.0

        }

    }
我的主要目标是让用户能够在不必等待动画完成的情况下继续向下/向上滚动表格,但如果您也能在动画完成之前找到与按钮交互的方法,那将是一个额外的好处