-2

I wanted to disable animated in viewDidAppear. I've set the code below but it shows me this error:

"cannot assign to value: 'animated' is a 'let' constant"

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated = false)
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Nur II
  • 173
  • 1
  • 2
  • 16

1 Answers1

1

You are trying to assign a value to the animated parameter and parameters are let constants, hence the error.

If you simply want to pass false to super.viewDidAppear then simply pass false:

super.viewDidAppear(false)

There is no need to attempt to assign a value to the original animated property.

rmaddy
  • 314,917
  • 42
  • 532
  • 579