Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Work around apple bug, where PDFs in WKWebView brings up an invisible… #113

Open
wants to merge 1 commit into
base: master
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
6 changes: 6 additions & 0 deletions TouchVisualizer/Visualizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ extension Visualizer {

var topWindow = UIApplication.shared.keyWindow!
for window in UIApplication.shared.windows {
// Case where webview brings up a fake empty keyboard when displaing a PDF on iPad and keeping it up until a keyboard is actually needed/used
// Affects iOS 12, 13, 14
if String(describing: type(of: window)) == "UIRemoteKeyboardWindow" && window.subviews.first?.subviews.first?.frame.size.height == 0 {
continue
}

if window.isHidden == false && window.windowLevel > topWindow.windowLevel {
topWindow = window
}
Expand Down