I converted existing custom plugin to Swift language:
(located under Plugins/CustomPluginInSwift.swift
)
import Foundation
class Cu
As is mentioned you have to add a bridging-header.h file which contains
#import
Also you need to add the bridging header's path in XCode project properties->Build Settings->Objective-C Bridging Header. For example:
your-app-name/plugins/com.plugin.example/bridging-header.h
Additionally, in order for Objective-C to see the same plugin class name, you need to add an @objc mapping to the class declaration. It can be the same as the swift class name itself, or something different. In this example, "HWPCustomPluginInSwift" will be what Objective-C (and Javascript) will end up seeing:
@objc(HWPCustomPluginInSwift) class CustomPluginInSwift : CDVPlugin {
and then your feature node in config.xml file should look like this: