plugnative-cordova-swiftstarter

cordova plugin for switch ios native language objectiv-c to swift.

Usage no npm install needed!

<script type="module">
  import plugnativeCordovaSwiftstarter from 'https://cdn.skypack.dev/plugnative-cordova-swiftstarter';
</script>

README

Welcome to PlugNative

Install

Checkout this repo and switch ios plugin development with swift language for ios above v 7

$ cordova plugin add <path>

Afterwards open xcode by

$ open platforms/ios/<Project Name>.xcodeproj

go into settings change deployment target to 7.0 or above and add <Project Name>/Plugins/com.example.hello/Bridging-Header.h to Objective-c Bridging Header under the Swift Compiler - Code Generation options

Finally add the following LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Test

Add the following to index.js onDeviceReady:


var win = function (result) {
    alert(result);      
}, 
fail = function (error) {
    alert("ERROR " + error);
};

hello.greet("World", win, fail);