apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 990 forks source link

MainViewController.m omit empty `viewDidLoad` to avoid warnings #904

Closed msmtamburro closed 1 month ago

msmtamburro commented 4 years ago

Bug Report

Problem

Thanks for removing the deprecated viewDidUnload! If you also remove some of the other empty methods (e.g., viewDidLoad) this gives developers a way to easily create an extension on MainViewController.m to implement those methods without warning.

What is expected to happen?

A developer should be able to implement viewDidLoad in MainViewController.m

What does actually happen?

Using the existing stub creates either architectural issues (e.g., changing a file that will get overwritten) or warnings (as mentioned the extension approach above).

Information

You might just remove all empty methods, and replace them with a comment like:

The best way to customize viewDidLoad is to make a Swift Extension of MainViewController and implement the method there. You can add your extension to your project by including it in a plugin.

Command or Code

Environment, Platform, Device

Version information

Checklist

dpogue commented 1 year ago

We actually use viewDidLoad now in the MainViewController to control the visibility of the splashscreen image (since doing it in CDVViewController causes it to appear unexpectedly when embedding and using CDVViewController as one view in a larger app) 😞