I have a UISearchBar that I want to display when the user taps a button. In the buttonPress method, I create the searchBar and add it as a subview, then call [searchBar becomeFirstResponder]. If I take out this becomeFirstResponder call, …
So I've tried everything trying to get a search bar into the navigation bar in Swift. But sadly I haven't gotten it working, just yet...
For those of you who don't know what I'm talking about, I'm trying to do …
I know how to remove/change UISearchBar background color around search field:
[[self.searchBar.subviews objectAtIndex:0] removeFromSuperview];
self.searchBar.backgroundColor = [UIColor grayColor];
But don't know how to do this inside it like that:
This needs to be compatible with iOS 4.3+.