Tabs implementation
Favicons and stuff too
This commit is contained in:
@@ -19,6 +19,8 @@ class BrowserView: UIView
|
||||
|
||||
var webView: WKWebView? {
|
||||
didSet {
|
||||
oldValue?.removeFromSuperview()
|
||||
|
||||
if let toolbarView = toolbarView {
|
||||
insertSubview(webView!, belowSubview: toolbarView)
|
||||
} else {
|
||||
@@ -36,12 +38,12 @@ class BrowserView: UIView
|
||||
|
||||
addSubview(titlebarView)
|
||||
|
||||
keyboardWillShowObserver = NotificationCenter.default.publisher(for: UIWindow.keyboardWillShowNotification).sink { notification in
|
||||
self.adjustOffsetForKeyboardNotification(userInfo: notification.userInfo!)
|
||||
keyboardWillShowObserver = NotificationCenter.default.publisher(for: UIWindow.keyboardWillShowNotification).sink { [weak self] notification in
|
||||
self?.adjustOffsetForKeyboardNotification(userInfo: notification.userInfo!)
|
||||
}
|
||||
|
||||
keyboardWillHideObserver = NotificationCenter.default.publisher(for: UIWindow.keyboardWillHideNotification).sink { notification in
|
||||
self.adjustOffsetForKeyboardNotification(userInfo: notification.userInfo!)
|
||||
keyboardWillHideObserver = NotificationCenter.default.publisher(for: UIWindow.keyboardWillHideNotification).sink { [weak self] notification in
|
||||
self?.adjustOffsetForKeyboardNotification(userInfo: notification.userInfo!)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +61,7 @@ class BrowserView: UIView
|
||||
}
|
||||
}(animationCurve)
|
||||
|
||||
self.keyboardLayoutOffset = bounds.height - keyboardEndFrame.minY
|
||||
keyboardLayoutOffset = bounds.height - keyboardEndFrame.minY
|
||||
UIView.animate(withDuration: animationDuration, delay: 0.0, options: animationOptions, animations: { self.layoutIfNeeded() }, completion: nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user