Hi,
I have an Ionic app which is referencing a Cordova plugin that we are developing. The Cordova plugin is referencing an iOS Framework which is created/developed in Swift.
The plugin’s config.xml is like this (note dependency on cordova-plugin-add-swift-support:
...
<dependency id="cordova-plugin-add-swift-support" version="1.7.2" />
<js-module name="Native" src="www/Native.js">
<clobbers target="NativeFunction" />
</js-module>
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="NativeFunction">
<param name="ios-package" value="NativeFunction"/>
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/ios/NativeFunction.swift" />
<framework src="src/ios/MyCorePlatform.framework" custom="true" embed="true"/>
</platform>
I’m then trying to reference the framework in my Swift class:
import MyCorePlatform
@objc(NativeFunction)
class NativeFunction : CDVPlugin {
@objc(getVersion:)
func getVersion(command: CDVInvokedUrlCommand) {
//
}
}
I’m trying this in Xcode, after doing an ionic cordova prepare ios
command. When I try and compile, I am getting the following error:
Could not build Objective-C module 'MyCorePlatform'
Has anyone faced this before and can offer any suggestions?