I\'m trying to remove border of UISearchBar in iOS 7. In iOS 6 it\'s working fine. I created the UISearchBar programatically. I tried almost every thing from Stack Overflow
Okay. There are so many answers, but they are too complex. I've found this solution:
Swift 3 (4)
searchBar.setBackgroundImage(UIImage(), for: .top, barMetrics: .default)
searchBar.backgroundColor = .primary
Where .primary is
extension UIColor {
static var primary:UIColor {
return "#5163F4".color
}
}