KeyboardLayoutGuide is unusable on iOS17 Release Candidate. Constantly reporting wrong values and missing updates.
Sample app description
NavigationController with two ViewControllers, the first one making use of KeyboardLayoutGuide to place a view on top of the keyboard, second ViewController with an InputField.
Here the logic using keyboardLayoutGuide.
class FirstViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let v = UILabel()
v.textColor = .white
v.textAlignment = .center
v.text = "View always above Keyboard"
v.backgroundColor = .blue
v.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(v)
NSLayoutConstraint.activate([
v.leadingAnchor.constraint(equalTo: view.leadingAnchor),
v.trailingAnchor.constraint(equalTo: view.trailingAnchor),
v.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor),
])
}
}
iPhone Scenario
- Push the second ViewController
- Focus the Input Field
- Pop the ViewController
KeyboardLayoutGuide will report to the first ViewController as the keyboard is still visible, misplacing any view that makes use of it.
iPad Scenario 1
- Enable Stage Manager
- Run the Sample app and any other app side by side
- Focus on any input field on the second app
- KeyboardLayoutGuide will correctly update the view that makes use of it on the Sample App.
- Tap on the Sample app to acquire focus
KeyboardLayoutGuide won't be updated, misplacing any views that makes use of it.
iPad Scenario 2
- Run the Sample app and any other app side by side
- Focus on any input field on the second app
- Rotate the device
KeyboardLayoutGuide will misplace any view that makes use of it.
Feedback was submitted FB12844057