devedbox / AXWebViewController

AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.
MIT License
797 stars 133 forks source link

建议增加WKWebView的title的KVO #35

Closed glary closed 7 years ago

glary commented 7 years ago

AXWebViewController版本: ? 1.2.7

Xcode版本: ? 8.3.2

iOS/OSX版本: ?8.0

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

devedbox commented 7 years ago

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

glary commented 7 years ago

@devedbox thank you

glary commented 7 years ago

还是没有添加title的KVO呀?

devedbox commented 7 years ago

增加title的kvo用意何在?

glary commented 7 years ago

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

devedbox commented 7 years ago

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

devedbox commented 7 years ago

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

glary commented 7 years ago

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 commented 7 years ago

@glary 你试了可以吗?

glary commented 7 years ago

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

glary commented 7 years ago

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

devedbox commented 7 years ago

@glary 行,我改改.

devedbox commented 7 years ago

@glary 新版为:0.6.0.

devedbox commented 7 years ago

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

glary commented 7 years ago

thank you~