Title bar

This commit is contained in:
James Magahern
2020-07-29 14:16:25 -07:00
parent 9f506c879f
commit f330293606
6 changed files with 101 additions and 1 deletions

View File

@@ -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
}