Everyone tells me \"Use super.viewDidLoad() because it\'s just like that\" or \"I\'ve been doing it always like that, so keep it\", \"It\'s wrong if you don\'t call super\",
When inheriting directly from UIViewController
, call super
when its documentation tells you to.
For example, viewWillAppear(Bool) says, "If you override this method, you must call super
at some point in your implementation," whereas viewDidLoad() does not.
If you are not inheriting directly from UIViewController
and the class you are inheriting from does not have reliable documentation, or may silently introduce a breaking change requiring that super
be called, then always call super
.