Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios swift 3-如何关闭网络视图中的页面(选项卡)_Ios_Xcode_Webview_Swift3 - Fatal编程技术网

Ios swift 3-如何关闭网络视图中的页面(选项卡)

Ios swift 3-如何关闭网络视图中的页面(选项卡),ios,xcode,webview,swift3,Ios,Xcode,Webview,Swift3,在viewcontroller中,我使用此代码打开本地html文件 self.webView = WKWebView(frame: webFrame, configuration: config) self.webView?.uiDelegate = self as? WKUIDelegate self.webView?.navigationDelegate = self self.webView?.scrollView.bounces = false self.container!.add

在viewcontroller中,我使用此代码打开本地html文件

self.webView = WKWebView(frame: webFrame, configuration: config)
self.webView?.uiDelegate = self as? WKUIDelegate 
self.webView?.navigationDelegate = self 
self.webView?.scrollView.bounces = false
self.container!.addSubview(webView!) 
let testUrl: URL! = Bundle.main.url(forResource: "index", withExtension: "html", subdirectory: "assets") 
self.webView!.loadFileURL(testUrl, allowingReadAccessTo: testUrl)
通过safari在菜单“开发人员”>“模拟器”中调试显示打开的页面(index.html)。每次我离开此viewControler并返回时,都会在菜单“开发人员”>“模拟器”中添加一个新页面(index.html,index.html,…)。我相信新的页面是在新的标签中打开的 在用于退出此viewController的函数中,我使用以下代码

self.webView?.removeFromSuperview()
self.container.removeFromSuperview()
对象已删除,但页面未删除,有人知道如何删除它们吗