diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 6009f6ff1..100e12e40 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -101,6 +101,7 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable { ]) fullScreenTapZone.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapNavigationBar))) navigationItem.titleView = fullScreenTapZone + configureNavbar() articleExtractorButton.addTarget(self, action: #selector(toggleArticleExtractor(_:)), for: .touchUpInside) toolbarItems?.insert(UIBarButtonItem(customView: articleExtractorButton), at: 6) @@ -229,6 +230,27 @@ class ArticleViewController: UIViewController, MainControllerIdentifiable { } + override func contentScrollView(for edge: NSDirectionalRectEdge) -> UIScrollView? { + return currentWebViewController?.webView?.scrollView + } + + func configureNavbar() { + let scrollEdge = UINavigationBarAppearance() + scrollEdge.configureWithOpaqueBackground() + scrollEdge.shadowColor = nil + scrollEdge.shadowImage = UIImage() + + let standard = UINavigationBarAppearance() + standard.shadowColor = .opaqueSeparator + standard.shadowImage = UIImage() + + navigationController?.navigationBar.standardAppearance = standard + navigationController?.navigationBar.compactAppearance = standard + navigationController?.navigationBar.scrollEdgeAppearance = scrollEdge + navigationController?.navigationBar.compactScrollEdgeAppearance = scrollEdge + } + + // MARK: Notifications @objc dynamic func unreadCountDidChange(_ notification: Notification) { diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 38b83c1b2..d5c04f8d8 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -31,7 +31,7 @@ class WebViewController: UIViewController { private var topShowBarsViewConstraint: NSLayoutConstraint! private var bottomShowBarsViewConstraint: NSLayoutConstraint! - private var webView: PreloadedWebView? { + var webView: PreloadedWebView? { return view.subviews[0] as? PreloadedWebView }