dpogue commented on PR #1457:
URL: https://github.com/apache/cordova-ios/pull/1457#issuecomment-2292366642

   Current feedback is that some plugins are (unsafely!) trying to add category 
extensions to the template's `AppDelegate` class. This was never really a safe 
thing to do, since people can consume CordovaLib as a framework in their own 
projects with whatever class names they want.
   
   The correct way for plugins to add behaviour to the app delegate is by 
extensions of the `CDVAppDelegate` base class.
   
   The same issue probably exists with the view controller class as well.
   
   ---
   
   For the sake of compatibility though, I'm looking at wrapping the 
`AppDelegate` and `ViewController` Swift classes in `@objc` and create empty 
header files for them with deprecation warnings.
   
   ```c
   // AppDelegate.h
   #import <Cordova/Cordova.h>
   
   #warning It is unsafe to rely on the AppDelegate class as an extension 
point. \
            Update your code to extend CDVAppDelegate instead -- \
            This code will stop working in Cordova iOS 9!
   
   @interface AppDelegate : CDVAppDelegate
   @end
   ```
   
   ```swift
   // AppDelegate.swift
   import Cordova;
   
   @objc class AppDelegate : CDVAppDelegate
   {
   }
   ```
   
   The downside of this method is that we're stuck with these compatibility 
hacks for at least one major version.
   
   We also have to alias the `ViewController` class as `MainViewController` in 
ObjC for compatibility.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to