You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2018/12/29 08:27:50 UTC

[incubator-weex-site] branch draft updated: Update extend-ios and extend-swift.

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

moshen pushed a commit to branch draft
in repository https://gitbox.apache.org/repos/asf/incubator-weex-site.git


The following commit(s) were added to refs/heads/draft by this push:
     new cfe5340  Update extend-ios and extend-swift.
cfe5340 is described below

commit cfe5340cf6e7769dedcb644f53ddc3572391237f
Author: wqyfavor <qi...@taobao.com>
AuthorDate: Sat Dec 29 16:27:40 2018 +0800

    Update extend-ios and extend-swift.
---
 docs/guide/extend/extend-ios-with-swift.md    |  8 --------
 docs/guide/extend/extend-ios.md               | 17 +++--------------
 docs/zh/guide/extend/extend-ios-with-swift.md |  2 +-
 docs/zh/guide/extend/extend-ios.md            |  8 +++-----
 4 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/docs/guide/extend/extend-ios-with-swift.md b/docs/guide/extend/extend-ios-with-swift.md
index 5d39a9f..1671a40 100644
--- a/docs/guide/extend/extend-ios-with-swift.md
+++ b/docs/guide/extend/extend-ios-with-swift.md
@@ -1,11 +1,3 @@
----
-title: Extend iOS with swift
-type: guide
-group: Extend
-order: 6.4
-version: 2.1
----
-
 ## Swift In Weex
 
 [Swift and Objective-C](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-ID122) mix-up
diff --git a/docs/guide/extend/extend-ios.md b/docs/guide/extend/extend-ios.md
index 2426b67..b8bee58 100644
--- a/docs/guide/extend/extend-ios.md
+++ b/docs/guide/extend/extend-ios.md
@@ -1,19 +1,8 @@
----
-title: Extend iOS
-type: guide
-group: Extend
-order: 6.4
-version: 2.1
----
-
-<!-- toc -->
-
 > **NOTICE**: **All of the exported APIs in Weex are controllable and safe, they can not access private APIs or do any system hacks at runtime,  neither can they change the primary purpose of the Application**.
 >
-> **If you are extending your custom modules/components, be sure NOT to export the ability of Objective-C runtime, be sure NOT to export  dynamic and uncontrolled methods such as `dlopen()`, `dlsym()`, `respondsToSelector:`, `performSelector:`, `method_exchangeImplementations()`, be sure NOT to export any private methods. **
+> **If you are extending your custom modules/components, be sure NOT to export the ability of Objective-C runtime, be sure NOT to export  dynamic and uncontrolled methods such as `dlopen()`, `dlsym()`, `respondsToSelector:`, `performSelector:`, `method_exchangeImplementations()`, be sure NOT to export any private methods.**
 
-Weex SDK provides only rendering capabilities, rather than have other capabilities. There are some internal [components](../wiki/component-introduction.html), [modules](../wiki/module-introduction.html) and [handlers](../wiki/handler-introduction.html). If you want these features which weexSDK doesn't provide, you can to extend.
-> The following section we will extend iOS using Objective-C and here is [swift](./extend-module-using-swift.html).
+In this section we will talk about how to extend Weex on iOS using Objective-C. For Swift, please refer [Extend using Swift](./extend-ios-with-swift.html)
 
 ## Extend module
 
@@ -193,7 +182,7 @@ Weex offers component life cycle hooks that give you visibility into these key m
 
 #### Add method for component
 
-From WeexSDK `0.9.5`, you can define your component method by macro `WX_EXPORT_METHOD`
+You can define your component method by macro `WX_EXPORT_METHOD`
 
 ```Objective-C
 @implementation WXMyComponent
diff --git a/docs/zh/guide/extend/extend-ios-with-swift.md b/docs/zh/guide/extend/extend-ios-with-swift.md
index c6e635f..f4ebeb4 100644
--- a/docs/zh/guide/extend/extend-ios-with-swift.md
+++ b/docs/zh/guide/extend/extend-ios-with-swift.md
@@ -1,4 +1,4 @@
-## Swift In Weex
+## 使用 Swift 扩展 Weex
 
 [Swift和Objective-C](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-ID122) 混编
 
diff --git a/docs/zh/guide/extend/extend-ios.md b/docs/zh/guide/extend/extend-ios.md
index 6056742..7f81246 100644
--- a/docs/zh/guide/extend/extend-ios.md
+++ b/docs/zh/guide/extend/extend-ios.md
@@ -1,9 +1,7 @@
 > 注意:Weex 所有暴露给 JS 的内置 module 或 component API 都是安全和可控的,它们不会去访问系统的私有 API,也不会去做任何 runtime 上的 hack 更不会去改变应用原有的功能定位。  
-> 如果需要扩展自定义的 module 或者 component ,一定注意不要将 OC 的 runtime 暴露给 JS , 不要将一些诸如 `dlopen()`, `dlsym()`, `respondsToSelector:`,`performSelector:`,`method_exchangeImplementations()` 的动态和不可控的方法暴露给JS, 也不要将系统的私有API暴露给JS
+> 如果需要扩展自定义的 module 或者 component ,一定注意不要将 OC 的 runtime 暴露给 JS ,不要将一些诸如 `dlopen()`, `dlsym()`, `respondsToSelector:`,`performSelector:`,`method_exchangeImplementations()` 的动态和不可控的方法暴露给JS,也不要将系统的私有API暴露给JS。否则将可能面临苹果上架审核问题。
 
-Weex SDK 只提供渲染,提供了一些默认的组件和能力,如果你需要一些特性但 Weex 并未提供,可以通过扩展自定义的一些插件来实现,通过 WeexSDK 加载。
-
-本文都以 Objective-C 为例子书写,如果需要 swift 请参考 [使用 swift 扩展 Weex](/guide/extend-ios-with-swift.html)。
+在这篇文档里,我们使用 Objective-C 来扩展 Weex 功能,如果想使用 Swift,可以参考 [使用 Swift 扩展](./extend-ios-with-swift.html)。
 
 ## 自定义 module
 自定义 module,需要让自己的 class 遵循 `WXModuleProtocol` 这个protocol,通过 `WX_EXPORT_METHOD` 这个宏暴露出需要透出到 `JavaScript` 调用的方法,再向 WeexSDK 注册 module,就可以完成一个简单 module 的自定义。
@@ -175,7 +173,7 @@ export default {
 
 #### 给组件添加方法
 
-WeexSDK 0.9.5 之后支持了在 js 中直接调用组件的方法。
+在组件代码中使用宏 `WX_EXPORT_METHOD` 声明组件方法供前端调用。
 
 ```Objective-C
 @implementation WXMyComponent