How to make status bar transparent when using UISearchController
<p>I was creating my own custom UISearchBar and UISearchController, following <a href="http://www.appcoda.com/custom-search-bar-tutorial/" rel="nofollow noreferrer">this tutorial</a> and I wanted to add my own background using searchBar.setBackgroundImage() but the problem is that the image doesn't span the status bar as well. So I get a white status bar that looks like this:</p>

<p><a href="https://i.stack.imgur.com/4DJSd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4DJSd.png" alt="enter image description here"></a></p>

<p>Anyone know how to fix this?</p>