Tabs implementation

Favicons and stuff too
This commit is contained in:
James Magahern
2020-07-30 23:54:20 -07:00
parent bba9efbbb6
commit 6baf543da3
14 changed files with 487 additions and 105 deletions

View File

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