Skip to content

Commit

Permalink
添加文档
Browse files Browse the repository at this point in the history
  • Loading branch information
ToBeDefined committed Oct 15, 2017
1 parent 761e732 commit 734a21a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ Most of the parameters and methods are same like UIWebView, the following descri

> Get cookies in `NSHTTPCookieStorage` and set the cookie for TWebView, the `forceOverride` parameter control use the cookie value in `NSHTTPCookieStorage` to reset the cookie of the same name that existed before TWebView, if `forceOverride` is `NO/false`, will don't reset the same name cookie.
- `- (void)getDocumentTitle:(void (^)(NSString * _Nullable))completion`

> Take out the page's `title` to `completion`(it was use `JavaScript` to get the web page in the `document.title`)
- `+ (nullable NSString *)getJavascriptStringWithFunctionName:(NSString *)function data:(id)data`

> Class method to get `JavaScript function`, `function` parameter to access the JavaScript method name (no need to add brackets), `data` parameters can be `JSON Object` or ordinary `NSString`, will automatically convert Stitching; returns a function call string after splicing.
Expand Down
4 changes: 4 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ github "tobedefined/TWebKit" ~> 1.1.1

> 取出`NSHTTPCookieStorage`中的cookies设置TWebView的cookie,`forceOverride`参数控制是否强制使用`NSHTTPCookieStorage`中的cookie值重设TWebView之前存在的同名的cookie
- `- (void)getDocumentTitle:(void (^)(NSString * _Nullable))completion`

> 取出网页的`title`放入block `completion`,使用`JavaScript`获得网页HTML中的`document.title`
- `+ (nullable NSString *)getJavascriptStringWithFunctionName:(NSString *)function data:(id)data`

> 类方法提供拼接JavaScript函数功能,`function`参数为要访问的JavaScript的方法名(不需要添加括号),`data`参数可以为`JSON Object`或者为普通的`NSString`,会自动进行转换拼接;返回拼接后的函数调用字符串。
Expand Down

0 comments on commit 734a21a

Please sign in to comment.