0

I've seen implementations of the UIViewController life cycle methods, where the super method was called at the beginning, like this:

override func viewDidLoad() {
    super.viewDidLoad()
    // Do stuff after super call.
}

But I have also seen this:

override func viewDidDisappear(_ animated: Bool) {
    // Do stuff before super call.
    super.viewDidDisappear(animated)
}

When should super be called at the end?

Sergio
  • 1,610
  • 14
  • 28
  • ViewDidDisappear cleans off the stuff in your VC so later you will not have a chance to do it anymore. After that, it's over :) – DungeonDev Feb 27 '20 at 14:31
  • 1
    You could check my answer on the duplicate question: https://stackoverflow.com/a/60436107/5501940 – Ahmad F Feb 27 '20 at 15:02

0 Answers0