[ 
https://issues.apache.org/jira/browse/CB-10071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570662#comment-16570662
 ] 

ASF GitHub Bot commented on CB-10071:
-------------------------------------

dpogue commented on issue #107: CB-10071: (ios) Proposal swift support
URL: https://github.com/apache/cordova-discuss/pull/107#issuecomment-410819414
 
 
   This seems good, and should remove the need for people to fiddle with hook 
scripts or extra plugins just to get Swift working.
   
   Regarding plugins written in Swift, how do you envision they would specify 
the compatible Swift version? I guess they could inject it into the platform's 
config.xml and let the app's config.xml override it?
   
   Plugin specifies Swift 4.0 in its plugin.xml:
   ```xml
   <!-- plugin.xml -->
   <plugin ...>
     <platform name="ios">
       <config-file parent="/*" target="config.xml">
         <preference name="SwiftVersion" value="4.0" />
       </config-file>
     </platform>
   </plugin>
   ```
   
   Application config.xml specifies Swift 4.1:
   ```xml
   <!-- config.xml -->
   <widget ...>
     <platform name="ios">
       <preference name="SwiftVersion" value="4.1." />
     </platform>
   </widget>
   ```
   
   Result: Swift 4.1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Proposal: feature to merge Swift bridging headers
> -------------------------------------------------
>
>                 Key: CB-10071
>                 URL: https://issues.apache.org/jira/browse/CB-10071
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-lib
>            Reporter: Shazron Abdullah
>            Priority: Major
>              Labels: backlog
>             Fix For: [email protected]
>
>
> 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:
> {code}
> <header-file src="Foo.h" type="SwiftObjcBridgingHeader" />
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to