Simplify WebView loading on iOS.

This commit is contained in:
Brent Simmons
2025-04-28 21:00:31 -07:00
parent 0a364c7c00
commit b7d4041781
7 changed files with 59 additions and 235 deletions

View File

@@ -7,6 +7,7 @@
//
import UIKit
import WebKit
import RSCore
import RSWeb
import Account
@@ -97,10 +98,10 @@ class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
private let keyboardManager = KeyboardManager(type: .timeline)
override var keyCommands: [UIKeyCommand]? {
// If the first responder is the WKWebView (PreloadedWebView) we don't want to supply any keyboard
// If the first responder is the WKWebView 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
}