I have looked through dozens of posts/youtube videos to try to achieve this.
My searchbar is currently set like so:
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = true
it is set to be initially hidden and once I scroll down, it reveals without issues.
The problem is when I scroll up and "compact" it, it will not stay hidden under the navigation bar but instead jumps right back down again and stays visible.
I'm trying to achieve the exact same thing as in the iMessage app, where you can hide/unhide the search bar and large title by dragging down/pushing up the tableView.
Much appreciated :)