cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

MainViewController.m omit empty `viewDidLoad` to avoid warnings

Open msmtamburro opened this issue 5 years ago • 1 comments

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

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

msmtamburro avatar Jun 17 '20 15:06 msmtamburro

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) 😞

dpogue avatar Apr 16 '23 02:04 dpogue