You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2018/09/12 01:25:37 UTC

[cordova-discuss] branch master updated: CB-10071: (ios) Proposal swift support (#107)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-discuss.git


The following commit(s) were added to refs/heads/master by this push:
     new 10b2f9c  CB-10071: (ios) Proposal swift support (#107)
10b2f9c is described below

commit 10b2f9cf18a6f77494f85e6e8bc7c5d8d75c193e
Author: Ken Naito <fi...@gmail.com>
AuthorDate: Wed Sep 12 10:25:35 2018 +0900

    CB-10071: (ios) Proposal swift support (#107)
    
    * CB-10071: (ios) Proposal swift support
    * Set status to completed
---
 proposals/ios-swift-plugin-support.md | 70 +++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/proposals/ios-swift-plugin-support.md b/proposals/ios-swift-plugin-support.md
new file mode 100644
index 0000000..f92ec78
--- /dev/null
+++ b/proposals/ios-swift-plugin-support.md
@@ -0,0 +1,70 @@
+# Swift Plugin Support
+- Status: Completed
+
+## Overview
+
+The purpose of this proposal is to support iOS plugin written by Swift.
+I propose introducing two functions. 
+
+- The first function will edit the `Bridging-Header.h` according to the settings defined in `plugin.xml`. 
+
+- The second is setting the application’s Swift version according to the settings defined in `config.xml`.
+
+Note that we can specify the Swift version for the application. Plugins with different Swift version can not be imported simultaneously. This is contrary with CocoaPod libraries in which Swift version can be specified for each.
+
+
+## Bridging-Header
+
+Introduce the `BridgingHeader` type attribute value in the `header-file` tag in plugin.xml
+
+ex.
+```
+<header-file src="src/ios/Hoge-Bridging-Header.h" type="BridgingHeader" />
+```
+
+This specification is similar to the proposal https://issues.apache.org/jira/browse/CB-10071 where the value is `SwiftObjcBridgingHeader`. The specification here is little simpler.
+
+When the `type` attribute is set to `BridgingHeader`, the `Bridging-Header.h` file, located in cordova-ios template is updated as
+
+```
+#import <Cordova/CDV.h>
+#import "Plugins/cordova-plugin-xxxx/Hoge-Bridging-Header.h"
+```
+
+This new feature, i.e. updating `Bridging-Header.h` file, is working at 
+
+`after plugin add`
+`after plugin rm`
+
+
+Do not introduce any other auxiliary files such as ios.json to manage plugins' BridgingHeader files.
+Therefore if two plugins specify the sample BridgingHeader file, although this hardly occurs, `updated Bridging-Header.h` becomes as follows,
+
+```
+#import <Cordova/CDV.h>
+#import "Plugins/cordova-plugin-xxxx/Hoge-Bridging-Header.h"
+#import "Plugins/cordova-plugin-xxxx/Hoge-Bridging-Header.h"
+```
+
+After removing one plugin, this becomes
+
+```
+#import <Cordova/CDV.h>
+#import "Plugins/cordova-plugin-xxxx/Hoge-Bridging-Header.h"
+```
+
+## Select application swift version
+
+Introducing the `SwiftVersion` preference tag option in `config.xml`.
+
+ex.
+```
+<preference name="SwiftVersion" value="4.1" />
+```
+
+This specifies the Swift version of the application, by calling the Xcode module. This is set after the following command(s):
+
+`cordova prepare`
+
+Do not introduce any other auxiliary files such as ios.json to manage which swift versions is fixed or not.
+Therefore updating swift version is performed every time after doing `cordova prepare` if the above preference exists in `config.xml`.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org