Adrian
Adrian

Reputation: 20068

How to disable an UITableViewCell custom animation?

I have a custom animation for my table view done inside willDisplay delegate.
I want this animation to be disabled in one case, but I don't know how to do this.

I tried doing this in viewDidLoad:

UIView.setAnimationsEnabled(false)

But the animation is still performed. Any other way to disable animations on IOS ?

Upvotes: 1

Views: 350

Answers (1)

Shehata Gamal
Shehata Gamal

Reputation: 100503

You can disable it yourself

var enabled  = true

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

      if enabled {
         // do animation
      }
      else {

      }

   }

Upvotes: 2

Related Questions