ios – Animation of UI View in desk view cell just isn’t constant


For some motive, when the cell that is being animated goes off-screen and comes again, the animation velocity modifications. Upon tapping the cell, a brand new view controller is opened. After I returned from the view controller to the preliminary view, the animation stopped altogether.

To date, I’ve tried to begin the animation in cellForRowAt, however that did not appear to work both.

Hyperlink to video for the issue:

Beneath is the code for willDisplay cell and the capabilities for animating my ui view inside my desk view cell.

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        if let cell = cell as? DirectionSummaryTableViewCell {
            if let isLive = cell.isLive {
                if isLive {
                } else {
func animateBusStatusBackground() {

        UIView.animate(withDuration: 1.0, delay: 0.0, choices: [.repeat, .autoreverse, .curveEaseInOut], animations: { [weak self] in
            if self?.busStatusView.backgroundColor == .purple {
                self?.busStatusView.backgroundColor = .grey6
            } else {
                self?.busStatusView.backgroundColor = .purple
        }, completion: nil)
func removeAnimation() {

How do I repair this in order that the animation is similar on a regular basis?


Leave a Reply