Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议增加WKWebView的title的KVO #35

Closed
glary opened this issue May 9, 2017 · 15 comments
Closed

建议增加WKWebView的title的KVO #35

glary opened this issue May 9, 2017 · 15 comments

Comments

@glary
Copy link
Contributor

glary commented May 9, 2017

AXWebViewController版本: ? 1.2.7

Xcode版本: ? 8.3.2

iOS/OSX版本: ?8.0

依赖管理工具(cocoapods)版本: ?1.2.7

@devedbox
Copy link
Owner

@glary 最新版本:v0.5.0已发布.

@glary
Copy link
Contributor Author

glary commented May 15, 2017

@devedbox thank you

@glary glary closed this as completed May 15, 2017
@glary glary reopened this May 15, 2017
@glary
Copy link
Contributor Author

glary commented May 15, 2017

还是没有添加title的KVO呀?

@devedbox
Copy link
Owner

增加title的kvo用意何在?

@glary
Copy link
Contributor Author

glary commented May 15, 2017

就是 让tittle 跟随网页来显示,我发现一个bug,就是iOS8以上的时候h5那边用JS刷新了title,但是你这个控制器标题不会变。

@devedbox
Copy link
Owner

@glary 如果网页是SPA的,使用js来改变Title你确定web view的Title能跟随改变?

@glary glary closed this as completed May 15, 2017
@glary glary reopened this May 15, 2017
@devedbox
Copy link
Owner

@glary 我试了,添加Title kvo之后没有收到回调. 微信的web 浏览是他自己的引擎,用的不是苹果原生的库.

@glary
Copy link
Contributor Author

glary commented May 15, 2017

#if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
[self progressProxy];
#else
[_webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:NULL];
[_webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];

/*
 [_webView.scrollView addObserver:self forKeyPath:@"backgroundColor" options:NSKeyValueObservingOptionNew context:NULL];
 */

#endif

我在这个位置加的,在回调中可以接收到标题的改变

@devedbox
Copy link
Owner

@glary 你试了可以吗?

@glary
Copy link
Contributor Author

glary commented May 15, 2017

@devedbox 可以的,你点下面的更多推荐里的商品 可以看到标题会变。

@glary
Copy link
Contributor Author

glary commented May 15, 2017

还有就是 你这个库依赖AFSecurityPolicy 会跟依赖AFNetworking 的项目冲突吗? 我更新到0.5.0 报一个找不到AFSecurityPolicy.h的错。

@devedbox
Copy link
Owner

@glary 行,我改改.

@devedbox
Copy link
Owner

@glary 新版为:0.6.0.

@devedbox
Copy link
Owner

@glary 这个帖子含金量高啊!冲突那个是之前测试的,没修改,幸亏你及时发现了冲突的那个问题!

@glary
Copy link
Contributor Author

glary commented May 15, 2017

thank you~

@glary glary closed this as completed May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
P::Title of web view.
Awaiting triage
Development

No branches or pull requests

2 participants