I am trying to accomplish the same look of my UISearchBar with a TextField within it, as in my iOS 6 app. I have tried to code it in several ways and not yet been successful
Swift solution
for subView in searchBar.subviews{
for deeperView in subView.subviews{
if let searchField:UITextField = deeperView as? UITextField{
searchField.layer.borderWidth = 1.0
searchField.layer.borderColor = UIColor(red: 134/255, green: 14/255, blue: 75/255, alpha: 1).CGColor
searchField.layer.cornerRadius = 5.0
}
}
}