如何使用 WkWebView additem 到 backforwardList [英] How to use WkWebView additem to backforwardList

查看:12
本文介绍了如何使用 WkWebView additem 到 backforwardList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个 url 添加到我的 WkWebView 的后向列表中,但我似乎无法找到它是如何完成的.Apple 文档显示此链接 WebBackForwardList 并且我尝试导入 WebKit.h 但我找不到添加项目的方法:- (void)addItem:(WebHistoryItem *)item

Im trying to add a url to the back forward list of my WkWebView but I can't seem to find how it can be done. Apple doc shows this link WebBackForwardList and I've tried importing WebKit.h but I can't find the method to add the item: - (void)addItem:(WebHistoryItem *)item

谁能指出我正确的方向?谢谢!

Can anyone point me in the right direction? Thanks!

推荐答案

WKWebView 类的 BackForwardList 是只读属性,您不应自行更改它.项目将添加到(或从)该列表中删除,因为用户将在给定的 web 视图中浏览 URL.

BackForwardList of a WKWebView class is a readonly property and you shouldn't alter it by yourself. Items will be added to (and removed from) this list as the user will navigate through URL's in the given webview.

如果由于某种原因 BackForwardList 功能不足以满足您的要求,我建议您实现自己的导航堆栈.

If for some reason BackForwardList functionality is not enough for your requirements, I would suggest implementing your own navigation stack.

这篇关于如何使用 WkWebView additem 到 backforwardList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆