Reputation: 33297
PhoneGap/Cordova for iOS is currently based on an ObjectiveC project.
How can I run a PhoneGap/Cordova app based on a Swift project?
Upvotes: 1
Views: 3956
Reputation: 13178
The other answer works but it is manual.
You can automate how you convert a project to swift from Cordova's output. Take a look at this project:
https://github.com/akofman/cordova-plugin-add-swift-support
That project has a hook that runs after platform add and it will add a bridging header as well as the proper settings to make the project work with Swift code. You can use it as a plugin.
Upvotes: 1
Reputation: 64644
Cordova-ios is built with Objective-C, and I don't believe that's going to change any time soon. You can use Swift and Objective-C in the same project though, so nothing is stopping you from writing iOS plugins in Swift. You will have to add a bridging header though. You can see an example of a Swift cordova plugin here.
Upvotes: 2