Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func setupSearchController() {
- searchController.searchBar.placeholder = "Search Routines"
- navigationItem.searchController = searchController
- searchController.searchBar.setupSearchBarAppearance()
- }
- func setupSearchBarAppearance() {
- if let textfield = value(forKey: "searchField") as? UITextField {
- if let backgroundview = textfield.subviews.first {
- backgroundview.backgroundColor = UIColor(red: 49/255, green: 69/255, blue: 89/255, alpha: 1.0)
- backgroundview.layer.cornerRadius = 10;
- backgroundview.clipsToBounds = true;
- }
- }
- }
- func setupSearchBarAppearance() {
- if let textfield = value(forKey: "searchField") as? UITextField {
- if let backgroundview = textfield.subviews.first {
- // Changing this to a default color works
- backgroundview.backgroundColor = UIColor.green
- backgroundview.layer.cornerRadius = 10;
- backgroundview.clipsToBounds = true;
- }
- }
- }
Add Comment
Please, Sign In to add comment