Title bar
This commit is contained in:
@@ -19,8 +19,11 @@ class BrowserViewController: UIViewController,
|
||||
private var blockedScriptOrigins = Set<String>()
|
||||
override var canBecomeFirstResponder: Bool { true }
|
||||
|
||||
private var titleObservation: NSKeyValueObservation?
|
||||
private var loadingObservation: NSKeyValueObservation?
|
||||
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle { .lightContent }
|
||||
|
||||
init() {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
@@ -64,6 +67,11 @@ class BrowserViewController: UIViewController,
|
||||
self.toolbarController.urlBar.loadProgress = .loading(progress: webView.estimatedProgress)
|
||||
}
|
||||
|
||||
// Title observer
|
||||
titleObservation = webView.observe(\.title, changeHandler: { (webView, observedChange) in
|
||||
self.browserView.titlebarView.titleLabelView.text = webView.title
|
||||
})
|
||||
|
||||
self.view = browserView
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user