Hi all,
I’ve been experimenting with swift and ported the HelloWorld plugin [1] to
Swift. There was one trick to make it work together with cordova, that was to
specify the name of the class to export it under so it could be referenced:
@objc(HWPHello) class Hello : CDVPlugin {
Then it’s ‘exported’ under “HWPHello” that is what we put into the plugin.xml
that can then be found at runtime by cordova
There remains one problem in order to use CDVPlugin in Swift one needs to add a
bridging header file and add that to the swift compiler options. The file can
be part of the plugin but can cordova on plugin install add the needed compiler
settings?
[1] https://github.com/edewit/cordova-plugin-hello/tree/swift