Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: VisitableView NavigationBar glitch #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Source/Turbo/Visitable/VisitableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open class VisitableView: UIView {
open func activateWebView(_ webView: WKWebView, forVisitable visitable: Visitable) {
self.webView = webView
self.visitable = visitable
addSubview(webView)
insertSubview(webView, belowSubview: activityIndicatorView)
addFillConstraints(for: webView)
installRefreshControl()
showOrHideWebView()
Expand Down Expand Up @@ -68,7 +68,7 @@ open class VisitableView: UIView {
guard let scrollView = webView?.scrollView, allowsPullToRefresh else { return }

#if !targetEnvironment(macCatalyst)
scrollView.addSubview(refreshControl)
scrollView.insertSubview(refreshControl, belowSubview: webView!)

/// Infer refresh control's default height from its frame, if given.
/// Otherwise fallback to 60 (the default height).
Expand Down Expand Up @@ -155,7 +155,12 @@ open class VisitableView: UIView {
open func showScreenshot() {
guard !isShowingScreenshot, !isRefreshing else { return }

addSubview(screenshotContainerView)
if let webView = webView {
insertSubview(screenshotContainerView, aboveSubview: webView)
} else {
addSubview(screenshotContainerView)
}

addFillConstraints(for: screenshotContainerView)
showOrHideWebView()
}
Expand Down