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
UISearchBar
PFQueryTableViewController
With the Swift 4.0 RELEASE 2017-09-19 toolchain, this worked:
let cancelButtonAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] UIBarButtonItem.appearance(whenContainedInInstancesOf: [UISearchBar.self]).setTitleTextAttributes(cancelButtonAttributes, for: .normal)