Replace old iOS WKWebView flash prevention code with new technique

This commit is contained in:
Maurice Parker
2023-04-16 14:08:48 -05:00
parent f4e71b41a1
commit 2ada885656
6 changed files with 59 additions and 126 deletions

View File

@@ -7,6 +7,7 @@
//
import UIKit
import WebKit
import SwiftUI
import Account
import Articles
@@ -37,7 +38,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma
// If the first responder is the WKWebView (PreloadedWebView) we don't want to supply any keyboard
// commands that the system is looking for by going up the responder chain. They will interfere with
// the WKWebViews built in hardware keyboard shortcuts, specifically the up and down arrow keys.
guard let current = UIResponder.currentFirstResponder, !(current is PreloadedWebView) else { return nil }
guard let current = UIResponder.currentFirstResponder, !(current is WKWebView) else { return nil }
return keyboardManager.keyCommands
}