1

I'm using a GMSAutocompleteViewController but the placeholder and Cancel button is not appearing clearly. For this I want to change the placeholder color and the cancel button color. How can I do that. Please help me out. enter image description here

1 Answers1

1
UINavigationBar.appearance().tintColor = .white // cancel button
    
    
    UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).attributedPlaceholder = NSAttributedString(
      string: "Search",
      attributes: [NSAttributedString.Key.foregroundColor: UIColor(hexString: "#4B4B4C").withAlphaComponent(0.8)]
  ) // placeholder
    
    UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).tintColor = .gray // cursor color