iOS15 Keyboard Layout Guide

Starting from iOS15, to adjust the layout when keyboard is shown/hidden, we do not need to import third party library IQKeyboardManager or do the math ourselves.

iOS has a new native layout guide named keyboardLayoutGuide. All you have to do is to anchor bottom of your view to the top of the keyboardLayoutGuide:

KeyboardLayoutGuide

To try out this new feature, I created a view with a scroll view and some text fields inside it. My scroll view’s bottom is anchored to keyboardLayoutGuide’s top. Here’s the result:

--

--

No responses yet