In a previous article, we talk about appearance change of
UINavigationBar in iOS13. Today I want to add some more changes you should know when using
Adding search controller can make a navigation bar disappear #
In UINavigationBar changes in iOS13, Part1, I said that scroll edge appearance (transparent navigation bar) would be used only with large title navigation bar. But this is no longer a case. If you add
UISearchController to a navigation bar, scroll edge appearance might be used.
The system will use scroll edge appearance when
hidesSearchBarWhenScrolling set to
true. So your navigation bar might become transparent even you don't use the large title appearance.
Search bar always show #
UISearchBar will show without a need of scrolling if you set
false (Always show search bar).
But if you set
true it will hide by default and reveal when you pull a scroll view down.
UISearchBar will always show regardless of
hidesSearchBarWhenScrolling value. I think this is a good change. It makes search function front and center. Easy to discover, easy to access. Plus, it makes everything more consistency.
The following are screenshots of the difference between iOS12 and iOS13.
From left to right, small title with
hidesSearchBarWhenScrolling == true, small title with
hidesSearchBarWhenScrolling == false, large title with
hidesSearchBarWhenScrolling == true, large title with
hidesSearchBarWhenScrolling == false.
And these are animations of hiding/showing state in iOS12 and iOS13.
I love an obvious interface. It makes a feature you spend time coding more discoverable. I always think the search bar should show by default.
Fun fact: I used to have a search function in one of my apps hidden like the one in iOS12. Once in a while, I will receive an email asking for a search function. I stop receiving that after making the search function more obvious.
I got sick this week, but I want to keep the ball rolling, so this article might be a bit short.
Related Resources #
Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.
If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.Become a patron Tweet Share