title: UISearchBar custom corners
body: <p>I'm trying to create a search bar like this:</p>
  
  <p><img src="https://i.stack.imgur.com/98Gc5.jpg" alt="enter image description here"></p>
  
  <p>But I'm noticing that I'm probably going to have to replace the search bar with my own image because the search bar corners comes out wrong when I set:</p>
  
  <pre><code>self.searchController.searchBar.layer.cornerRadius = 50 // I've tried other numbers besides this too with no luck
  self.searchController.searchBar.clipsToBounds = true
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/TdUJ7.png" alt="enter image description here"></p>
  
  <p>If I set this:</p>
  
  <pre><code>self.searchController.searchBar.layer.cornerRadius = self.searchController.searchBar.bounds.height/2
  </code></pre>
  
  <p>The search bar comes out like this:</p>
  
  <p><img src="https://i.stack.imgur.com/choTt.png" alt="enter image description here"></p>
  
  <p>Which still isn't exact like in the image.</p>
  
  <p>Is there a way to replace the left and right side of the textfield with an image that way I can use the rounded corners from my custom search bar?</p>