Skip to content

Commit

Permalink
fix: add iOS 18+ fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ensan-hcl committed Aug 21, 2024
1 parent ea00358 commit bdaa6a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Keyboard/Display/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ final class KeyboardViewController: UIInputViewController {
// ただしこの時点でのUIScreen.mainの値はOSバージョンで変わる
debug("KeyboardViewController.viewWillTransition", size, UIScreen.main.bounds.size)
SemiStaticStates.shared.setScreenWidth(size.width)
KeyboardViewController.variableStates.setInterfaceSize(orientation: UIScreen.main.bounds.width < UIScreen.main.bounds.height ? .horizontal : .vertical, screenWidth: size.width)
if #available(iOS 18, *) {
KeyboardViewController.variableStates.setInterfaceSize(orientation: UIScreen.main.bounds.width < UIScreen.main.bounds.height ? .vertical : .horizontal, screenWidth: size.width)
} else {
KeyboardViewController.variableStates.setInterfaceSize(orientation: UIScreen.main.bounds.width < UIScreen.main.bounds.height ? .horizontal : .vertical, screenWidth: size.width)
}
}

override func viewDidLayoutSubviews() {
Expand Down

0 comments on commit bdaa6a0

Please sign in to comment.