Skip to content

Commit

Permalink
Merge pull request #474 from ensan-hcl/fix/ios18_design
Browse files Browse the repository at this point in the history
fix: iOS 18以降でレイアウトが崩れる問題を修正
  • Loading branch information
ensan-hcl authored Aug 21, 2024
2 parents fe4967a + bdaa6a0 commit cb4a50f
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 cb4a50f

Please sign in to comment.