I'd like to migrate my tableHeaderView based search bar to the new seamless search bar approach in iOS 11 by configuring navigationItem.searchController.
Since my navigation bar uses a custom background image, I'm wondering how to apply the same background image to the search bar as well. I tried
[navigationBar setBackgroundImage:[UIImage imageNamed:@"NavigationBarPromptBackground"] forBarMetrics:UIBarMetricsDefaultPrompt];
[searchBar setBackgroundImage:[UIImage imageNamed:@"NavigationBarBackground"] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
to no avail. The search bar keeps the standard navigation bar background (with a barTintColor applied) but doesn't show the custom background image.