I moved from the old iOS 10 style of placing UISearchBar inside the tableHeaderView to the new iOS 11 style of placing a searchController inside the navigationItem.
I have also set self.navigationItem.hidesSearchBarWhenScrolling = YES;
.
However, I want to observe when the search bar gets shown vs hidden (while scrolling) so that I can reposition a view. Unfortunately, this view was not written with constraints so I have to resort to this approach.
So, the question is how can I 'observe' this behavior? (KVO? Notification? Some kind of property or delegate method I can use?)