I have added a UISearchBar
to the top of my PFQueryTableViewController
. I have changed the colour of the searchBar to be the colour of my app, but
All the above answers didn't work for me. (Got 'Type 'NSAttributedString.Key' (aka 'NSString') has no member 'foregroundColor'' error)
Maybe because I'm at Swift 3...
Here's the slightly-modified code that worked for me:-
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UISearchBar.self]).setTitleTextAttributes([NSForegroundColorAttributeName : .black], for: .normal)
Note:-
If you are using UISearchController, insert this code to 'willPresentSearchController:' or 'didPresentSearchController:'