title: How to clear UISearchBar background color in iOS10 Swift?
body: <p>There are older version of this question for older versions of iOS no longer works due to the layout changes in UISearchBar.</p>
  
  <p>I've tried the following to completely remove the background color of UISearchBar but it doesn't work. (I tried to look up the hierarchy views of it but xCode kept crashing for this option.)</p>
  
  <pre><code>private func clearBackgroundColor() {
      for view in self.subviews {
          view.backgroundColor = UIColor.clear
          for subview in view.subviews {
              subview.backgroundColor = UIColor.clear
          }
      }
  } 
  </code></pre>
  
  <p>Any ideas or suggestions?</p>
  
  <p>Thanks!!</p>