title: How to implement plain search bar in IOS
body: <p>I want to remove border for default search bar and implement plain search bar. See image below</p>
  
  <p>Default search bar,</p>
  
  <p><img src="https://i.stack.imgur.com/AVsSs.png" alt="Default Search Bar"></p>
  
  <p>This is what I am trying to achieve,</p>
  
  <p><img src="https://i.stack.imgur.com/u9pkJ.png" alt="Plain Search bar"> </p>
  
  <p>I googled and tried below code but does not achieve the desired effect,</p>
  
  <pre><code>for (id img in searchbar.subviews) 
  {
      if ([img isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) 
      {
          [img removeFromSuperview];
      }
  }
  
  searchbar.delegate = self;
  searchbar.layer.borderWidth = 0;
  searchbar.layer.borderColor = [[UIColor clearColor] CGColor];
  </code></pre>
  
  <p>How can I implement this?</p>