[iOS 11] Hiding search bar when view controller's view is not a scroll view.

I have a view controller (let's call it Parent) whose view has two other embedded view controllers. One of these embedded VCs is a table view controller, so when the user scrolls that, it should behave like other scroll views in the app/system. However, in iOS 11, when I add a search controller to Parent's `navigationItem` and set `hidesSearchBarWhenScrolling` to `true`, I get no effect. I'm guessing that's because Parent's view is not a scroll view, and I'm wondering whether:


a) there is a way to tie the hiding/showing behaviour of the search bar to a specific scroll view, or

b) there is a way to manually hide/show the search bar.


Thanks!

I'm looking for the same thing

The work around solution right now seems to be to put the containerView that houses the tableview above the other items in the storyboard.

[iOS 11] Hiding search bar when view controller's view is not a scroll view.
 
 
Q