How to use WkWebView additem to backforwardList

◇◆丶佛笑我妖孽 提交于 2021-02-10 05:33:09

问题


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!


回答1:


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.

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



来源:https://stackoverflow.com/questions/30633517/how-to-use-wkwebview-additem-to-backforwardlist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!