开发者

IPhone development-- how to get bookmarks and history data from UIWebView?

开发者 https://www.devze.com 2023-03-13 00:58 出处:网络
As the description of title, Whic开发者_Go百科h interface of UIWebView should I call to get these data?I don\'t think this is possible with the current API. You will have to maintain state i.e. track

As the description of title, Whic开发者_Go百科h interface of UIWebView should I call to get these data?


I don't think this is possible with the current API. You will have to maintain state i.e. track bookmarks and history data but that too from user's usage of your UIWebView instance. You can't get the data of Mobile Safari. Although UIWebView instance allows you to navigate back and forth indicating that it does maintain some sort of state, all of it is cloaked inside the UIWebViewInternal class.


One way to maintain your own history is to implement the delegate method:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

When the navigation type is UIWebViewNavigationTypeLinkClicked you can add it to your own history array.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号