我为自己的论坛制作了一个WebView应用程序。效果很好。但是,如果我要转到管理面板,它将无法打开。它将打开一个新的Tab,但是我想我没有在代码中添加它。
有人可以帮助我吗?
Here is my Code:
//
// ViewController.swift
// Street Grinders
//
// Created by Jörg Quick on 20.11.18.
// Copyright © 2018 FH Darmstadt. All rights reserved.
//
import UIKit
import WebKit
class ViewController: UIViewController {
@IBOutlet weak var WebView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
//Lade Webseite https://www.street-grinders.de
let url = URL(string: "https://www.street-grinders.de")
let request = URLRequest(url: url!)
//Lade Webview
WebView.load(request)
//Gestensteuerung aktivieren
WebView.allowsBackForwardNavigationGestures = true
//Lade die Seite neu wenn Push Down
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(reloadWebView(_:)), for: .valueChanged)
WebView.scrollView.addSubview(refreshControl)
}
@objc func reloadWebView(_ sender: UIRefreshControl) {
WebView.reload()
sender.endRefreshing()
}
}