Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including cordova-plugin-add-swift-support with all npm packages installed. Try it out:

cordova-plugin-add-swift-support lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("cordova-plugin-add-swift-support/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

cordova-plugin-add-swift-support v2.0.2

Add Swift support to your iOS plugins

npm version Build Status npm



This Cordova plugin adds the Swift support to your iOS project.


You can add this plugin directly to your project:

cordova plugin add cordova-plugin-add-swift-support --save

Or add it as a dependency into your own plugin:

<dependency id="cordova-plugin-add-swift-support" version="2.0.2"/>

By default, the Swift 4 support is added but the legacy version (2.3) can still be configured as a preference, inside the project's config.xml, within the <platform name="ios"> section:

<preference name="UseLegacySwiftLanguageVersion" value="true" />

Or it is possible to specify the version as following, inside the project's config.xml, within the <platform name="ios"> section:

<preference name="UseSwiftLanguageVersion" value="5" />

If needed, add a prefixed Bridging-Header file in your plugin in order to import frameworks (MyPlugin-Bridging-Header.h for instance). As an example you can have a look at this plugin.

If the cordova-plugin-add-swift-support plugin is already installed to your project, then you can add your own Swift plugin as usual, its prefixed Bridging-Header will be automatically found and merged.


The src folder contains ECMAScript 2015 source files, the minimum Node.js version is 6 (Boron).



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free