Daily iOS
UIKit

Chat input bar and keyboard layout

In a UIKit chat screen, the input bar has to sit right on top of the keyboard and follow it as it rises. How would you connect keyboard height changes to Auto Layout constraints?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

From iOS 15, constrain the input bar's bottom to view.keyboardLayoutGuide.topAnchor, and the system updates the constraint and matches the animation when the keyboard appears, disappears, or changes height, so no notification code is needed.

Share a question