Fix removal of tap zones when removing old web views

This commit is contained in:
Maurice Parker 2020-06-16 08:07:54 -05:00
parent 3b2fcb74fd
commit 4075da2ee8

View File

@ -300,8 +300,10 @@ extension WebViewController: UIContextMenuInteractionDelegate {
extension WebViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
while view.subviews.count > 1 {
view.subviews.last?.removeFromSuperview()
for (index, view) in view.subviews.enumerated() {
if index != 0, let oldWebView = view as? PreloadedWebView {
oldWebView.removeFromSuperview()
}
}
}