title: How to change text color of PlaceHolder in UISearchBar? (iOS 13)
body: <p>After looking for updated (<em>iOS 13</em>) answers, I didn't find any solutions to this simple problem :<br/><br/> How to change the <strong><code>textColor</code></strong> of the placeholder in an <strong><code>UISearchBar</code></strong> ?</p>
  
  <p>My app doesn't handle <strong><code>Light/Dark</code></strong> mode. I don't want the system to change my <strong><code>UIPlaceHolder</code></strong> text color. I want it to be always <code>white</code>.</p>
  
  <hr>
  
  <pre><code>    if #available(iOS 13.0, *) {
          let attrString = NSMutableAttributedString(string: "My PlaceHolder")
          attrString.addAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], range: NSRange(location: 0, length: attrString.length))
          searchController.searchBar.searchTextField.attributedPlaceholder = attrString
      }
  </code></pre>
  
  <p>I expected this code to work. I thought the new property <code>searchTextField</code> would have made it easier to customize my <code>UISearchBar</code>.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This code kind of works in the <code>viewDidAppear</code> method :</p>
  
  <pre><code>if #available(iOS 13.0, *) {
       searchController.searchBar.searchTextField.attributedPlaceholder = NSAttributedString(string: "My PlaceHolder", attributes: [NSAttributedString.Key.foregroundColor: UIColor.white.withAlphaComponent(0.80)])
   }
  </code></pre>
  
  <p>The issue is that the color is changing when you scroll up and down.</p>