如何在WKWebvView中获得头衔?

时间:2018-06-02 04:57:19

标签: cocoa title wkwebview

代码:

'import Cocoa
import WebKit

class ViewController: NSViewController, WKUIDelegate, WKNavigationDelegate {

let myURL = "https://google.com"

@IBOutlet var webView: WKWebView!



 @IBOutlet weak var titlepage: NSTextField!

override func viewDidLoad() {
    super.viewDidLoad()
    // Load Homepage URL in WebView
    webView.load(URLRequest(url: URL(string: myURL)!))

    self.titlepage = webView.title! // not working
    }

}'                                                   

0 个答案:

没有答案