dpogue opened a new pull request, #1295: URL: https://github.com/apache/cordova-ios/pull/1295
<!-- Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines: http://cordova.apache.org/contribute/contribute_guidelines.html Thanks! --> ### Platforms affected iOS ### Motivation and Context <!-- Why is this change required? What problem does it solve? --> <!-- If it fixes an open issue, please link to the issue here. --> See https://github.com/apache/cordova-ios/issues/1288 ### Description <!-- Describe your changes in detail --> This ensures that the default `init` method is called for CDVPlugin subclasses, to allow Swift initializers to run as expected. Aside: I still feel like `NS_DESIGNATED_INITIALIZER` would be the theoretically correct way to solve this, but that doesn't work when our designated initializer with the webview is part of private implementation details (your designated initializer must be part of your public API surface). The risk is that someone could (in their own code) do `[[MyCordovaPlugin alloc] init]` and try to construct a plugin instance without providing the webview engine, and lead to all sorts of weird issues. However, that problem already existed and people don't seem to be shooting themselves in the foot with it (or at least, not complaining here when they do), so it's probably better to fix the issue that is impacting people even if the solution isn't theoretically perfect. ### Testing <!-- Please describe in detail how you tested your changes. --> Added a unit test which ensures that an init-time property in a Swift plugin is correctly set after the plugin has been initialized. This test case fails without the changes to CDVPlugin.m. ### Checklist - [ ] I've run the tests to see all new and existing tests pass - [ ] I added automated test coverage as appropriate for this change - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) - [ ] I've updated the documentation if necessary -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
