How to adjust layout for UISearchBar keyboard

Check out How to adjust layout for UISearchBar keyboard by JR. Here is an excerpt:

See previous post for how to add and hook up a search bar. Setup something like this.

Screen Shot 2017-06-03 at 3.55.19 PM.png

Center the label.

Screen Shot 2017-06-03 at 3.57.02 PM.png

But also give it a custom height.

Screen Shot 2017-06-03 at 3.57.29 PM.png

We are going to calculate the value and turn that constraint ON/OFF depending on whether the keyboard is displayed or not.

Drag out the two constraints…

The full article is available here.