-3

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)
}
1
  • 1
    The _ indicates that it is an anonymous argument. So just super.viewDidAppear(false) Commented Dec 7, 2017 at 3:49

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.