change(ios): relocates the "enter foreground" kbd-reload trigger

Addresses part of #12216
This commit is contained in:
Joshua Horton 2025-02-05 14:00:41 +07:00
parent 558a57f72f
commit e9066b3d52
3 changed files with 9 additions and 9 deletions

View file

@ -589,7 +589,7 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
}
// KeymanWebViewController maintenance methods
func reload() {
public func reload() {
keymanWeb.reloadKeyboard()
}

View file

@ -72,14 +72,6 @@ class KeymanWebViewController: UIViewController {
super.init(nibName: nil, bundle: nil)
_ = view
NotificationCenter.default.addObserver(
forName: UIApplication.willEnterForegroundNotification,
object: nil,
queue: OperationQueue.main
) { _ in
self.reloadKeyboard()
}
}
required init?(coder aDecoder: NSCoder) {

View file

@ -112,6 +112,14 @@ class MainViewController: UIViewController, TextViewDelegate, UIActionSheetDeleg
forName: Notifications.keyboardRemoved,
observer: self,
function: MainViewController.keyboardRemoved)
NotificationCenter.default.addObserver(
forName: UIApplication.willEnterForegroundNotification,
object: nil,
queue: OperationQueue.main
) { _ in
Manager.shared.inputViewController.reload()
}
// Unfortunately, it's the main app with the file definitions.
// We have to gerry-rig this so that the framework-based SettingsViewController