Closed dpogue closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 78.30%. Comparing base (
fb8eeab
) to head (d4e26bc
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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.
// 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
// 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.
To Do
Platforms affected
iOS
Motivation and Context
Closes https://github.com/apache/cordova-ios/issues/674. Closes https://github.com/apache/cordova-ios/issues/904.
Description
Replace the existing template project with one that uses modern Swift classes, storyboards, and customizes the
CDVViewController
using storyboard properties rather than relying on specifically-named colour variables being globally available.This is one step that should make it easier and much more pleasant for people wanting to embed
CDVViewController
instances within their existing iOS apps.Testing
Built to a simulator. All existing tests pass.
Checklist