Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10071

Proposal: feature to merge Swift bridging headers

    XMLWordPrintableJSON

Details

    Description

      In cordova-ios-4.x we have a Bridging-Header.h file for Cordova classes, so this will enable Swift plugins.

      However, this is not adequate for Swift plugins that have to use third-party Objective-C libraries for their plugin itself. The plugins need to add the bridging headers to the app's Bridging-Header.h file (by appending to the file we already have).

      Firstly, we should never modify the app's Bridging-Header file, it should remain static (modifying this will be problematic for every `cordova prepare` cycle, for multiple plugins).

      We should have a feature to merge multiple bridging header files together, and point the SWIFT_OBJC_BRIDGING_HEADER value in build.xcconfig to it.

      An example of a Cordova plugin that has this problem: https://github.com/alongubkin/phonertc

      This could be an optional attribute in the `<header-file>` tag in plugin.xml:
      https://cordova.apache.org/docs/en/4.0.0/plugin_ref/spec.html

      I propose something like-this:

      <header-file src="Foo.h" type="SwiftObjcBridgingHeader" />
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shazron Shazron Abdullah
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: