How to change the colour of the 'Cancel' button on the UISearchBar in Swift : <p>I have added a <code>UISearchBar</code> to the top of my <code>PFQueryTableViewController</code>. I have changed the colour of the searchBar to be the colour of my app, but in doing this, it seems to have also changed the colour of the 'Cancel' button to the right of it to the same colour. Ideally, I want the colour to be White. </p>

<p>This image shows how it currently looks:</p>

<p><a href="https://i.stack.imgur.com/Xppcm.png"><img src="https://i.stack.imgur.com/Xppcm.png" alt=""></a></p>

<p>It looks like there is no 'Cancel' button, but there is, its just the same colour as the searchBar (You can still press it etc)</p>

<p>Is there a way for me to change the colour of this 'Cancel button to white? Everything i've tried seems to make no difference. </p>

<p>Code i've used to make the <code>UISearchBar</code> this colour is:</p>

<pre><code>UISearchBar.appearance().barTintColor = UIColor(hue: 359/360, saturation: 67/100, brightness: 71/100, alpha: 1)
UISearchBar.appearance().tintColor = UIColor(hue: 359/360, saturation: 67/100, brightness: 71/100, alpha: 1)
</code></pre>

<p>And in the storyboard i've set these:</p>

<p><a href="https://i.stack.imgur.com/ZfTy2.png"><img src="https://i.stack.imgur.com/ZfTy2.png" alt="enter image description here"></a></p>

<p>And finally, to make the placeholder, and text white inside the SearchBar, i've used:</p>

<pre><code>for subView in self.filmSearchBar.subviews {

    for subsubView in subView.subviews {

        if let searchBarTextField = subsubView as? UITextField {

            searchBarTextField.attributedPlaceholder = NSAttributedString(string: NSLocalizedString("Search Cinevu film reviews", comment: ""), attributes: [NSForegroundColorAttributeName: UIColor.whiteColor()])

            searchBarTextField.textColor = UIColor.whiteColor()

        }

    }

}
</code></pre>

<p>Thanks for any help! :)</p>
