Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyun-J committed Mar 10, 2021
1 parent 77f3a35 commit 65c3106
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 9 deletions.
39 changes: 33 additions & 6 deletions README-ko.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

# ToDo

1. Interface Event Listener 적용 (작업중)
2. Model을 사용하는 인터페이스 (고려중)
3. <u>*Flutter 버전 FlexHybirdApp*</u> (추진중)

# FlexibleHybrid

FlexibleHybridApp은 Web, Native 상호간의 Interface을 Promise로 구현하는 등, HybridApp을 개발하기 위해 여러 편의 기능을 제공하는 프레임워크 입니다.
Expand Down Expand Up @@ -201,16 +208,33 @@ mFlexWebView.evalFlexFunc("webFunc",["data1","data2"]) // same as $flex.web.webF
{ res -> Void in
// res is "data1"
}
component.evalFlexFunc("Retrun") // same as $flex.web.Retrun()
flexComponent.evalFlexFunc("Retrun") // same as $flex.web.Retrun()
{ res -> Void in
// res is "this is promise"
}
// just call function
component.evalFlexFunc("Retrun")
flexComponent.evalFlexFunc("Retrun")
// call function and send data
mFlexWebView.evalFlexFunc("webFunc",["data1","data2"])
```

### ***FlexClosure***
인터페이스 동작 코드 블럭을 원하는 위치에 코딩하기 위해 코드 블럭(Closure)을 따로 변수형으로 지정하여 사용할 수 있습니다.
```swift
let myAction : FlexClosure.action =
{ (action, arguments) -> Void on
action.promiseReturn("resurt")
}

let myIntInterface : FlexClosure.int =
{ arguments -> int? in
100
}
....
flexComponent.setAction("myAction", myAction)
flexComponent.intInterface("myIntInterface", myIntInterface)
```

# Native Class
FlexWebView를 비롯한 프레임워크의 Native class를 설명합니다.
## FlexWebView
Expand Down Expand Up @@ -313,11 +337,14 @@ func reject()
위 함수중 하나라도 호출했다면, 다음에 어떤 함수를 호출하더라도 Web에 값이 전달되지 않습니다.
FlexAction Class를 직접 생성 및 사용하면 아무런 효과도 얻을 수 없으며, 오직 인터페이스상에서 생성되어 전달되는 FlexAction만이 효력을 가집니다.

# $flex Object
# WebPage
## $flex Object
\$flex Object는 FlexWebView를 와 Promise 형태로 상호간 인터페이스가 구성되어있는 객체입니다.
$flex Object는 [Android FlexHybridApp](https://github.com/Kyun-J/FlexHybridApp-Android)에 적용될 때와 동일한 코드로 사용할 수 있습니다.
$flex는 액세스 가능한 모든 하위 프레임에서도 사용 할 수 있습니다. (Ex)Cross-Origin을 위반하지 않는 iframe)
$flex Object의 구성 요소는 다음과 같습니다.
\$flex Object는 [Android FlexHybridApp](https://github.com/Kyun-J/FlexHybridApp-Android)에 적용될 때와 동일한 코드로 사용할 수 있습니다.
\$flex는 웹뷰에 웹페이지 로드 시, 런타임으로 웹페이지에 선언됩니다.
\$flex가 로드 완료되는 시점은, window.onFlexLoad함수를 통해 확인할 수 있습니다.
\$flex는 액세스 가능한 모든 하위 프레임에서도 사용 할 수 있습니다. (Ex)Cross-Origin을 위반하지 않는 iframe)
\$flex Object의 구성 요소는 다음과 같습니다.
```js
window.onFlexLoad // Called after the $flex load completes. When overriding onFlexLoad, the overridden function is called immediately.
$flex // Object that contains functions that can call Native area as WebToNative
Expand Down
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[Android Version](https://github.com/Kyun-J/FlexHybridApp-Android)

# ToDo

1. Interface Event Listener (working)
2. Interface using Model (under consideration)
3. <u>*Flutter version of FlexHybirdApp*</u> (in progress)

# FlexibleHybrid

FlexibleHybridApp is a framework that provides various convenience functions to develop HybridApp, such as implementing interfaces between Web and Native with promises.
Expand Down Expand Up @@ -215,6 +221,23 @@ mFlexWebView.evalFlexFunc("Return")
mFlexWebView.evalFlexFunc("webFunc",["data1","data2"])
```

### ***FlexClosure***
In order to code the interface operation code block at the desired location, the code block (Closure) can be specified separately as a variable type and used.
```swift
let myAction : FlexClosure.action =
{ (action, arguments) -> Void on
action.promiseReturn("resurt")
}

let myIntInterface : FlexClosure.int =
{ arguments -> int? in
100
}
....
flexComponent.setAction("myAction", myAction)
flexComponent.intInterface("myIntInterface", myIntInterface)
```

# Native Class
Describes the native classes of the framework including FlexWebView.
## FlexWebView
Expand Down Expand Up @@ -317,10 +340,13 @@ func reject()
If any of the above functions is called, the next time any function is called, the value is not passed to the Web.
If you directly create and use FlexAction Class, there is no effect. Only FlexAction created and delivered on the interface is effective.

# $flex Object
# WebPage
## $flex Object
\$flex Object is an object composed of interfaces between FlexWebView and Promise.
$flex Object can be used with the same code as applied to [Android FlexHybridApp](https://github.com/Kyun-J/FlexHybridApp-Android).
$flex can also be used in any accessible frames. (Ex) iframe that does not violate Cross-Origin)
\$flex Object can be used with the same code as applied to [Android FlexHybridApp](https://github.com/Kyun-J/FlexHybridApp-Android).
\$flex is declared in the webpage at runtime when the webpage is loaded in the webview.
When \$flex is finished loading, you can check the window.onFlexLoad function.
\$flex can also be used in any accessible frames. (Ex) iframe that does not violate Cross-Origin)
The components of $flex Object are as follows.
```js
window.onFlexLoad // Called after the $flex load completes. When overriding onFlexLoad, the overridden function is called immediately.
Expand Down

0 comments on commit 65c3106

Please sign in to comment.