How to write cordova plugin in Swift with CocoaPods?

I want to write a Cordova plugin in Swift, and I also want to use CocoaPods.

I managed to write the Cordova plugin correctly in Swift without CocoaPods, and also used CocoaPods in the Objective-C plugin.

But I have problems with a mix of Swift and CocoaPods. CocoaPods requires "use_frameworks!". to import Swift libraries, but the Cordova plugin in Swift requires "Bridging-Header.h" (otherwise I have some errors regarding "CDVPlugin"). But Xcode cannot use both the framework and the Bridging-Header.

Any solutions to this problem?

+4
source share

Source: https://habr.com/ru/post/1655319/


All Articles